brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 7b8ccef Raw
50 lines · cpp
1int f(int i, int j = 2, int k = 5);2int f(float x, float y...);3 4class A {5 public:6  A(int, int, int);7};8 9void test() {10  A a(f(1, 2, 3, 4), 2, 3);11}12 13 14namespace NS {15  struct X { };16  struct Y { Y(X); };17  template <class T = int>18  void g(X, Y);19}20 21void test_adl() {22  NS::X x;23  g(x, x);24  (void)(f)(1, 2, 3);25  (void)(test, test, test, f)(1, 2, 3);26}27 28// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s29// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s30// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:17 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s31// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:19 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s32// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:20 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s33// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:21 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s34// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:7 %s -o - | \35// RUN:    FileCheck -check-prefix=CHECK-CC5 %s36// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:24:13 %s -o - | \37// RUN:    FileCheck -check-prefix=CHECK-CC1 %s38// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:25:31 %s -o - | \39// RUN:    FileCheck -check-prefix=CHECK-CC1 %s40// CHECK-CC1: OVERLOAD: [#int#]f(<#float x#>, float y)41// CHECK-CC1: OVERLOAD: [#int#]f(<#int i#>)42// CHECK-CC1-NOT, CHECK-CC2-NOT: OVERLOAD: A(43// CHECK-CC2: OVERLOAD: [#int#]f(float x, float y)44// CHECK-CC2-NOT: OVERLOAD: [#int#]f(int i)45// CHECK-CC3: OVERLOAD: A(<#int#>, int, int)46// CHECK-CC3: OVERLOAD: A(<#const A &#>)47// CHECK-CC3: OVERLOAD: A(<#A &&#>)48// CHECK-CC4: OVERLOAD: A(int, <#int#>, int)49// CHECK-CC5: OVERLOAD: [#void#]g(X, <#Y#>)50