Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeCompletion / templates.cpp
blob1c708457762d6363c604f2c1305a6b1931960237
1 namespace std {
2 template<typename T>
3 class allocator {
4 public:
5 void in_base();
6 };
8 template<typename T, typename Alloc = std::allocator<T> >
9 class vector : Alloc {
10 public:
11 void foo();
12 void stop();
14 template<typename Alloc> class vector<bool, Alloc>;
17 void f() {
18 std::vector<int> v;
19 v.foo();
20 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
21 // CHECK-CC1: allocator<<#typename T#>>
22 // CHECK-CC1-NEXT: vector<<#typename T#>{#, <#typename Alloc#>#}>
23 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-4):5 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
24 // CHECK-CC2: foo
25 // CHECK-CC2: in_base
26 // CHECK-CC2: stop
30 template <typename> struct X;
31 template <typename T> struct X<T*> { X(double); };
32 X<int*> x(42);
33 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):11 %s -o - | FileCheck -check-prefix=CHECK-CONSTRUCTOR %s
34 // CHECK-CONSTRUCTOR: OVERLOAD: X(<#double#>)
35 // (rather than X<type-parameter-0-0 *>(<#double#>)