| 1 |
// RUN: not %clang_cc1 -fsyntax-only -fshow-overloads=best -fno-caret-diagnostics %s 2>&1 | FileCheck %s |
| 2 |
struct S { |
| 3 |
S(void*); |
| 4 |
S(char*); |
| 5 |
S(unsigned char*); |
| 6 |
S(signed char*); |
| 7 |
S(unsigned short*); |
| 8 |
S(signed short*); |
| 9 |
S(unsigned int*); |
| 10 |
S(signed int*); |
| 11 |
}; |
| 12 |
void f(const S& s); |
| 13 |
|
| 14 |
// First call to f emits all candidates. Second call emits just the first 4. |
| 15 |
void g() { f(0); } |
| 16 |
// CHECK: {{conversion from 'int' to 'const S' is ambiguous}} |
| 17 |
// CHECK-NEXT: {{candidate constructor}} |
| 18 |
// CHECK-NEXT: {{candidate constructor}} |
| 19 |
// CHECK-NEXT: {{candidate constructor}} |
| 20 |
// CHECK-NEXT: {{candidate constructor}} |
| 21 |
// CHECK-NEXT: {{candidate constructor}} |
| 22 |
// CHECK-NEXT: {{candidate constructor}} |
| 23 |
// CHECK-NEXT: {{candidate constructor}} |
| 24 |
// CHECK-NEXT: {{candidate constructor}} |
| 25 |
|
| 26 |
void h() { f(0); } |
| 27 |
// CHECK: {{conversion from 'int' to 'const S' is ambiguous}} |
| 28 |
// CHECK-NEXT: {{candidate constructor}} |
| 29 |
// CHECK-NEXT: {{candidate constructor}} |
| 30 |
// CHECK-NEXT: {{candidate constructor}} |
| 31 |
// CHECK-NEXT: {{candidate constructor}} |
| 32 |
// CHECK-NEXT: {{remaining 4 candidates omitted; pass -fshow-overloads=all to show them}} |