brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 556fc4d Raw
71 lines · cpp
1template <typename T>2struct Foo {};3template <typename T>4struct Foo<T *> { Foo(T); };5 6void foo() {7  Foo<int>();8  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):12 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s9  // 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 %s14  // CHECK-CC2: OVERLOAD: Foo(<#int#>)15  // CHECK-CC2: OVERLOAD: Foo(<#const Foo<int *> &#>)16  // CHECK-CC2: OVERLOAD: Foo(<#Foo<int *> &&#>17}18 19namespace std {20template <typename E> struct initializer_list { const E *a, *b; };21} // namespace std22 23struct 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: {{.*}}char30  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 36auto b1 = Bar{};37// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):15 %s | FileCheck -check-prefix=CHECK-BRACED %s38Bar b2{};39// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):8 %s | FileCheck -check-prefix=CHECK-BRACED %s40static int consumeBar(Bar) { return 0; }41int b3 = consumeBar({});42// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):22 %s | FileCheck -check-prefix=CHECK-BRACED %s43 44struct Aggregate {45  int first;46  int second;47  int third;48};49 50Aggregate a{1, 2, 3};51// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):13 %s | FileCheck -check-prefix=CHECK-AGGREGATE-1 %s52// 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 %s55// 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 %s57// CHECK-AGGREGATE-3: OVERLOAD: Aggregate{int first, int second, <#int third#>}58 59Aggregate 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 %s61// 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 %s64// 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 %s66// 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 %s68// 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-empty70// CHECK-DESIG-5-NOT: OVERLOAD71