diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-11 18:28:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-11 18:28:39 +0000 |
commit | d1cd31aeb806077340be94e32429f3192cf139b0 (patch) | |
tree | 5e04820fa5b68ea3bd12ad2bc5e4496d94a56915 /test/CodeCompletion/templates.cpp | |
parent | ce82196076cd15f5ecfa029fcda8b58dc0146cf1 (diff) |
Teach code completion to instantiate templates when it needs to
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion/templates.cpp')
-rw-r--r-- | test/CodeCompletion/templates.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/CodeCompletion/templates.cpp b/test/CodeCompletion/templates.cpp index 5a0bdb19f1..ff5611823d 100644 --- a/test/CodeCompletion/templates.cpp +++ b/test/CodeCompletion/templates.cpp @@ -1,16 +1,28 @@ namespace std { template<typename T> - class allocator; + class allocator { + public: + void in_base(); + }; - template<typename T, typename Alloc = std::allocator<T> > class vector; + template<typename T, typename Alloc = std::allocator<T> > + class vector : Alloc { + public: + void foo(); + void stop(); + }; template<typename Alloc> class vector<bool, Alloc>; } void f() { - std:: - // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s + std::vector<int> v; + v.foo(); + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:18:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: allocator<<#typename T#>> // CHECK-CC1-NEXT: vector<<#typename T#>{#, <#typename Alloc#>#}> - + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:5 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s + // CHECK-CC2: foo + // CHECK-CC2: in_base + // CHECK-CC2: stop |