File: diag-overload-cand-ranges.cpp

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (72 lines) | stat: -rw-r--r-- 2,555 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s --strict-whitespace
// CHECK:      error: no matching function
template <typename T> struct mcdata {
  typedef int result_type;
};
template <class T> typename mcdata<T>::result_type wrap_mean(mcdata<T> const &);
// CHECK:      :{[[@LINE+1]]:19-[[@LINE+1]]:53}: note: {{.*}}: no overload of 'wrap_mean'
void add_property(double (*)(mcdata<double> const &));
void f() { add_property(&wrap_mean); }

// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+1]]:10-[[@LINE+1]]:51}: note: {{.*}}: cannot pass pointer to generic address space
void baz(__attribute__((opencl_private)) int *Data) {}
void fizz() {
  int *Nop;
  baz(Nop);
  // CHECK:    error: no matching function
  // CHECK:    :[[@LINE+1]]:53: note: {{.*}}: 'this' object is in address space '__private'
  __attribute__((opencl_private)) static auto err = [&]() {};
  err();
}

// CHECK:      error: no matching function
struct Bar {
// CHECK:      :{[[@LINE+1]]:26-[[@LINE+1]]:32}: note: {{.*}} would lose const qualifier
static void foo(int num, int *X) {}
// CHECK:      :{[[@LINE+1]]:17-[[@LINE+1]]:25}: note: {{.*}} no known conversion
static void foo(int *err, int *x) {}
};
void bar(const int *Y) {
  Bar::foo(5, Y);
}

struct InComp;

struct A {};
struct B : public A{};
// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+5]]:36-[[@LINE+5]]:50}: note: {{.*}}: cannot convert initializer
// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+3]]:36-[[@LINE+3]]:50}: note: {{.*}}: cannot convert argument
// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+1]]:11-[[@LINE+1]]:18}: note: {{.*}}: no known conversion
void hoge(char aa, const char *bb, const A& third);

// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+1]]:14-[[@LINE+1]]:16}: note: {{.*}}: cannot convert from base class
void derived(B*);

void func(const A &arg) {
  hoge(1, "pass", {{{arg}}});
  InComp *a;
  hoge(1, "pass", a);
  hoge("first", 5, 6);
  A *b;
  derived(b);
}

struct Q {
  // CHECK:    error: invalid operands
  // CHECK:    :[[@LINE+1]]:6: note: {{.*}}: 'this' argument has type 'const Q'
  Q &operator+(void*);
};

void fuga(const Q q) { q + 3; }

template <short T> class Type1 {};
// CHECK:      error: no matching function
// CHECK:      :{[[@LINE+1]]:43-[[@LINE+1]]:54}: note: {{.*}}: expects an lvalue
template <short T> void Function1(int zz, Type1<T> &x, int ww) {}

void Function() { Function1(33, Type1<-42>(), 66); }