| 1 |
template <typename T> |
| 2 |
struct Foo {}; |
| 3 |
template <typename T> |
| 4 |
struct Foo<T *> { Foo(T); }; |
| 5 |
|
| 6 |
void foo() { |
| 7 |
Foo<int>(); |
| 8 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):12 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s |
| 9 |
// CHECK-CC1: OVERLOAD: Foo() |
| 10 |
// CHECK-CC1: OVERLOAD: Foo(<#const Foo<int> &#>) |
| 11 |
// CHECK-CC1: OVERLOAD: Foo(<#Foo<int> &&#> |
| 12 |
Foo<int *>(3); |
| 13 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):14 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s |
| 14 |
// CHECK-CC2: OVERLOAD: Foo(<#int#>) |
| 15 |
// CHECK-CC2: OVERLOAD: Foo(<#const Foo<int *> &#>) |
| 16 |
// CHECK-CC2: OVERLOAD: Foo(<#Foo<int *> &&#> |
| 17 |
} |
| 18 |
|
| 19 |
namespace std { |
| 20 |
template <typename E> struct initializer_list { const E *a, *b; }; |
| 21 |
} // namespace std |
| 22 |
|
| 23 |
struct Bar { |
| 24 |
// CHECK-BRACED: OVERLOAD: Bar{<#int#>} |
| 25 |
Bar(int); |
| 26 |
// CHECK-BRACED: OVERLOAD: Bar{<#double#>, double} |
| 27 |
Bar(double, double); |
| 28 |
// FIXME: no support for init-list constructors yet. |
| 29 |
// CHECK-BRACED-NOT: OVERLOAD: {{.*}}char |
| 30 |
Bar(std::initializer_list<char> C); |
| 31 |
// CHECK-BRACED: OVERLOAD: Bar{<#const Bar &#>} |
| 32 |
// CHECK-BRACED: OVERLOAD: Bar{<#T *Pointer#>} |
| 33 |
template <typename T> Bar(T *Pointer); |
| 34 |
}; |
| 35 |
|
| 36 |
auto b1 = Bar{}; |
| 37 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):15 %s | FileCheck -check-prefix=CHECK-BRACED %s |
| 38 |
Bar b2{}; |
| 39 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):8 %s | FileCheck -check-prefix=CHECK-BRACED %s |
| 40 |
static int consumeBar(Bar) { return 0; } |
| 41 |
int b3 = consumeBar({}); |
| 42 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):22 %s | FileCheck -check-prefix=CHECK-BRACED %s |
| 43 |
|
| 44 |
struct Aggregate { |
| 45 |
int first; |
| 46 |
int second; |
| 47 |
int third; |
| 48 |
}; |
| 49 |
|
| 50 |
Aggregate a{1, 2, 3}; |
| 51 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):13 %s | FileCheck -check-prefix=CHECK-AGGREGATE-1 %s |
| 52 |
// CHECK-AGGREGATE-1: OVERLOAD: Aggregate{<#int first#>, int second, int third} |
| 53 |
// CHECK-AGGREGATE-1: OVERLOAD: Aggregate{<#const Aggregate &#>} |
| 54 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-4):16 %s | FileCheck -check-prefix=CHECK-AGGREGATE-2 %s |
| 55 |
// CHECK-AGGREGATE-2: OVERLOAD: Aggregate{int first, <#int second#>, int third} |
| 56 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):18 %s | FileCheck -check-prefix=CHECK-AGGREGATE-3 %s |
| 57 |
// CHECK-AGGREGATE-3: OVERLOAD: Aggregate{int first, int second, <#int third#>} |
| 58 |
|
| 59 |
Aggregate d{.second=1, .first=2, 3, 4, }; |
| 60 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):13 %s | FileCheck -check-prefix=CHECK-DESIG-1 %s |
| 61 |
// CHECK-DESIG-1: OVERLOAD: Aggregate{<#int first#>, int second, int third} |
| 62 |
// CHECK-DESIG-1: OVERLOAD: Aggregate{<#const Aggregate &#>} |
| 63 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-4):24 %s | FileCheck -check-prefix=CHECK-DESIG-2 %s |
| 64 |
// CHECK-DESIG-2: OVERLOAD: Aggregate{int first, int second, <#int third#>} |
| 65 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):34 %s | FileCheck -check-prefix=CHECK-DESIG-3 %s |
| 66 |
// CHECK-DESIG-3: OVERLOAD: Aggregate{int first, <#int second#>, int third} |
| 67 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-8):37 %s | FileCheck -check-prefix=CHECK-DESIG-4 %s |
| 68 |
// CHECK-DESIG-4: OVERLOAD: Aggregate{int first, int second, <#int third#>} |
| 69 |
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-10):38 %s | FileCheck -check-prefix=CHECK-DESIG-5 %s --allow-empty |
| 70 |
// CHECK-DESIG-5-NOT: OVERLOAD |