From 9d80212115baea9be681574131633a884a60b40a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 2 Mar 2011 17:09:35 +0000 Subject: 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. llvm-svn: 126844 --- .../test/Index/annotate-nested-name-specifier.cpp | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'clang/test/Index/annotate-nested-name-specifier.cpp') diff --git a/clang/test/Index/annotate-nested-name-specifier.cpp b/clang/test/Index/annotate-nested-name-specifier.cpp index 150a34af1b7..b2f6a26e611 100644 --- a/clang/test/Index/annotate-nested-name-specifier.cpp +++ b/clang/test/Index/annotate-nested-name-specifier.cpp @@ -110,7 +110,23 @@ struct X6 { typedef class outer_alias::inner::vector::template rebind::other type4; }; -// RUN: c-index-test -test-annotate-tokens=%s:13:1:111:1 %s | FileCheck %s +namespace outer { + namespace inner { + template class TT> + struct apply_meta { + typedef typename TT::type type; + }; + } +} + +template +struct X7 { + typedef T T_type; + typedef U U_type; + typedef outer_alias::inner::apply_meta 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) + -- cgit v1.2.3