brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 571186b Raw
29 lines · cpp
1template <int, char y> float overloaded(int);2template <class, int x> bool overloaded(char);3 4auto m = overloaded<1, 2>(0);5// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):21 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s6// CHECK-CC1: OPENING_PAREN_LOC: {{.*}}4:207// CHECK-CC1-DAG: OVERLOAD: [#float#]overloaded<<#int#>, char y>[#()#]8// CHECK-CC1-DAG: OVERLOAD: [#bool#]overloaded<<#class#>, int x>[#()#]9// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-5):24 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s10// CHECK-CC2-NOT: OVERLOAD: {{.*}}int x11// CHECK-CC2: OVERLOAD: [#float#]overloaded<int, <#char y#>>[#()#]12 13template <class T, T... args> int n = 0;14int val = n<int, 1, 2, 3>;15// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):18 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s16// CHECK-CC3: OVERLOAD: [#int#]n<class T, <#T ...args#>>17// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-3):24 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s18// CHECK-CC4: OVERLOAD: [#int#]n<class T, T ...args>19 20template <typename> struct Vector {};21template <typename Element, template <typename E> class Container = Vector>22struct Collection { Container<Element> container; };23// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):31 %s -o - | FileCheck -check-prefix=CHECK-CC5 %s24// CHECK-CC5: OVERLOAD: [#class#]Container<<#typename E#>>25Collection<int, Vector> collection;26// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):12 %s -o - | FileCheck -check-prefix=CHECK-CC6 %s27// CHECK-CC6: OVERLOAD: [#struct#]Collection<<#typename Element#>>28 29