1 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s --strict-whitespace
2 // CHECK: error: no matching function
3 template <typename T
> struct mcdata
{
4 typedef int result_type
;
6 template <class T
> typename mcdata
<T
>::result_type
wrap_mean(mcdata
<T
> const &);
7 // CHECK: :{[[@LINE+1]]:19-[[@LINE+1]]:53}: note: {{.*}}: no overload of 'wrap_mean'
8 void add_property(double (*)(mcdata
<double> const &));
9 void f() { add_property(&wrap_mean
); }
11 // CHECK: error: no matching function
12 // CHECK: :{[[@LINE+1]]:10-[[@LINE+1]]:51}: note: {{.*}}: cannot pass pointer to generic address space
13 void baz(__attribute__((opencl_private
)) int *Data
) {}
17 // CHECK: error: no matching function
18 // CHECK: :[[@LINE+1]]:53: note: {{.*}}: 'this' object is in address space '__private'
19 __attribute__((opencl_private
)) static auto err
= [&]() {};
23 // CHECK: error: no matching function
25 // CHECK: :{[[@LINE+1]]:26-[[@LINE+1]]:32}: note: {{.*}} would lose const qualifier
26 static void foo(int num
, int *X
) {}
27 // CHECK: :{[[@LINE+1]]:17-[[@LINE+1]]:25}: note: {{.*}} no known conversion
28 static void foo(int *err
, int *x
) {}
30 void bar(const int *Y
) {
37 struct B
: public A
{};
38 // CHECK: error: no matching function
39 // CHECK: :{[[@LINE+5]]:36-[[@LINE+5]]:50}: note: {{.*}}: cannot convert initializer
40 // CHECK: error: no matching function
41 // CHECK: :{[[@LINE+3]]:36-[[@LINE+3]]:50}: note: {{.*}}: cannot convert argument
42 // CHECK: error: no matching function
43 // CHECK: :{[[@LINE+1]]:11-[[@LINE+1]]:18}: note: {{.*}}: no known conversion
44 void hoge(char aa
, const char *bb
, const A
& third
);
46 // CHECK: error: no matching function
47 // CHECK: :{[[@LINE+1]]:14-[[@LINE+1]]:16}: note: {{.*}}: cannot convert from base class
50 void func(const A
&arg
) {
51 hoge(1, "pass", {{{arg
}}});
60 // CHECK: error: invalid operands
61 // CHECK: :[[@LINE+1]]:6: note: {{.*}}: 'this' argument has type 'const Q'
65 void fuga(const Q q
) { q
+ 3; }
67 template <short T
> class Type1
{};
68 // CHECK: error: no matching function
69 // CHECK: :{[[@LINE+1]]:43-[[@LINE+1]]:54}: note: {{.*}}: expects an lvalue
70 template <short T
> void Function1(int zz
, Type1
<T
> &x
, int ww
) {}
72 void Function() { Function1(33, Type1
<-42>(), 66); }