diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-02 17:09:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-02 17:09:35 +0000 |
commit | b6744efecba58792cce20d2d7b9ee39927c5422e (patch) | |
tree | 470ae4a6d4f93a14be79365283c811848ff9d26f /test/Index/annotate-nested-name-specifier.cpp | |
parent | 46bb4f1a3ac9517406887939612eb8df4b7be006 (diff) |
Push nested-name-specifier source location information into template
template arguments. I believe that this is the last place in the AST
where we were storing a source range for a nested-name-specifier
rather than a proper nested-name-specifier location structure. (Yay!)
There is still a lot of cleanup to do in the TreeTransform, which
doesn't take advantage of nested-name-specifiers with source-location
information everywhere it could.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/annotate-nested-name-specifier.cpp')
-rw-r--r-- | test/Index/annotate-nested-name-specifier.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/test/Index/annotate-nested-name-specifier.cpp b/test/Index/annotate-nested-name-specifier.cpp index 150a34af1b..b2f6a26e61 100644 --- a/test/Index/annotate-nested-name-specifier.cpp +++ b/test/Index/annotate-nested-name-specifier.cpp @@ -110,7 +110,23 @@ struct X6 { typedef class outer_alias::inner::vector<type>::template rebind<type>::other type4; }; -// RUN: c-index-test -test-annotate-tokens=%s:13:1:111:1 %s | FileCheck %s +namespace outer { + namespace inner { + template<typename T, template<class> class TT> + struct apply_meta { + typedef typename TT<T>::type type; + }; + } +} + +template<typename T, typename U> +struct X7 { + typedef T T_type; + typedef U U_type; + typedef outer_alias::inner::apply_meta<T_type, U_type::template apply> type; +}; + +// RUN: c-index-test -test-annotate-tokens=%s:13:1:128:1 %s | FileCheck %s // CHECK: Keyword: "using" [14:1 - 14:6] UsingDeclaration=vector[4:12] // CHECK: Identifier: "outer_alias" [14:7 - 14:18] NamespaceRef=outer_alias:10:11 @@ -404,3 +420,21 @@ struct X6 { // CHECK: Punctuation: "::" [110:72 - 110:74] TypedefDecl=type4:110:80 (Definition) // CHECK: Identifier: "other" [110:74 - 110:79] TypedefDecl=type4:110:80 (Definition) // CHECK: Identifier: "type4" [110:80 - 110:85] TypedefDecl=type4:110:80 (Definition) + +// Template template arguments +// CHECK: Keyword: "typedef" [126:3 - 126:10] ClassTemplate=X7:123:8 (Definition) +// CHECK: Identifier: "outer_alias" [126:11 - 126:22] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [126:22 - 126:24] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "inner" [126:24 - 126:29] NamespaceRef=inner:114:13 +// CHECK: Punctuation: "::" [126:29 - 126:31] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "apply_meta" [126:31 - 126:41] TemplateRef=apply_meta:116:12 +// CHECK: Punctuation: "<" [126:41 - 126:42] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "T_type" [126:42 - 126:48] TypeRef=T_type:124:13 +// CHECK: Punctuation: "," [126:48 - 126:49] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "U_type" [126:50 - 126:56] TypeRef=U_type:125:13 +// CHECK: Punctuation: "::" [126:56 - 126:58] TypedefDecl=type:126:74 (Definition) +// CHECK: Keyword: "template" [126:58 - 126:66] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "apply" [126:67 - 126:72] TypedefDecl=type:126:74 (Definition) +// CHECK: Punctuation: ">" [126:72 - 126:73] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "type" [126:74 - 126:78] TypedefDecl=type:126:74 (Definition) + |