1 // Note: the run lines follow their respective tests, since line/column 2 // matter in this test. 3 void f(float x, float y); 4 void f(int i, int j, int k); 5 struct X { }; 6 void f(X); 7 namespace N { 8 struct Y { 9 Y(int = 0); 10 11 operator int() const; 12 }; 13 void f(Y y, int ZZ); 14 } 15 typedef N::Y Y; 16 void f(); 17 18 void test() { 19 f(Y(), 0, 0); 20 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s 21 // CHECK-CC1: f(Y y, <#int ZZ#>) 22 // CHECK-CC1-NEXT: f(int i, <#int j#>, int k) 23 // CHECK-CC1-NEXT: f(float x, <#float y#>) 24 // CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>) 25 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s 26 // CHECK-CC2-NOT: f(Y y, int ZZ) 27 // CHECK-CC2: f(int i, int j, <#int k#>) 28 f({}, 0, 0); 29 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:28:7 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s 30 // CHECK-CC3: OVERLOAD: [#void#]f() 31 // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#X#>) 32 // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#int i#>, int j, int k) 33 // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#float x#>, float y) 34 } 35 36 void f(int, int, int, int); 37 template <typename T> 38 void foo(T t) { 39 f(t, t, t); 40 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:39:5 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s 41 // CHECK-CC4: f() 42 // CHECK-CC4-NEXT: f(<#X#>) 43 // CHECK-CC4-NEXT: f(<#int i#>, int j, int k) 44 // CHECK-CC4-NEXT: f(<#float x#>, float y) 45 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:39:8 %s -o - | FileCheck -check-prefix=CHECK-CC5 %s 46 // CHECK-CC5-NOT: f() 47 // CHECK-CC5: f(int i, <#int j#>, int k) 48 // CHECK-CC5-NEXT: f(float x, <#float y#>) 49 f(5, t, t); 50 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:49:11 %s -o - | FileCheck -check-prefix=CHECK-CC6 %s 51 // CHECK-CC6-NOT: f(float x, float y) 52 // CHECK-CC6: f(int, int, <#int#>, int) 53 // CHECK-CC6-NEXT: f(int i, int j, <#int k#>) 54 } 55