diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-27 19:42:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-27 19:42:20 +0000 |
commit | 66cd1dacbc4c2b58e356295261fb571db79706b1 (patch) | |
tree | 3ad6151ab65704416b87e5c505486c34b75de2e2 /clang/test/Index/annotate-tokens.cpp | |
parent | c8b39c7952d86738dd0bb84d59a8c3a14fde9b12 (diff) | |
download | bcm5719-llvm-66cd1dacbc4c2b58e356295261fb571db79706b1.tar.gz bcm5719-llvm-66cd1dacbc4c2b58e356295261fb571db79706b1.zip |
[libclang] Avoid having the cursor of an expression "overwrite" the annotation of the
variable declaration that it belongs to.
This can happen for C++ constructor expressions whose range generally
include the variable declaration, e.g.:
MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor.
rdar://9124499.
llvm-svn: 133929
Diffstat (limited to 'clang/test/Index/annotate-tokens.cpp')
-rw-r--r-- | clang/test/Index/annotate-tokens.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/test/Index/annotate-tokens.cpp b/clang/test/Index/annotate-tokens.cpp index ccc9e960284..165420ab39c 100644 --- a/clang/test/Index/annotate-tokens.cpp +++ b/clang/test/Index/annotate-tokens.cpp @@ -17,9 +17,10 @@ struct S1 { void f(); }; struct S2 { S1 *operator->(); }; void test3(S2 s2) { s2->f(); + X foo; } -// RUN: c-index-test -test-annotate-tokens=%s:1:1:20:1 %s | FileCheck %s +// RUN: c-index-test -test-annotate-tokens=%s:1:1:21:1 %s | FileCheck %s // CHECK: Keyword: "struct" [1:1 - 1:7] StructDecl=bonk:1:8 (Definition) // CHECK: Identifier: "bonk" [1:8 - 1:12] StructDecl=bonk:1:8 (Definition) // CHECK: Punctuation: "{" [1:13 - 1:14] StructDecl=bonk:1:8 (Definition) @@ -115,4 +116,7 @@ void test3(S2 s2) { // CHECK: Punctuation: "(" [19:8 - 19:9] CallExpr=f:16:18 // CHECK: Punctuation: ")" [19:9 - 19:10] CallExpr=f:16:18 // CHECK: Punctuation: ";" [19:10 - 19:11] UnexposedStmt= -// CHECK: Punctuation: "}" [20:1 - 20:2] UnexposedStmt= +// CHECK: Identifier: "X" [20:3 - 20:4] TypeRef=struct X:7:8 +// CHECK: Identifier: "foo" [20:5 - 20:8] VarDecl=foo:20:5 (Definition) +// CHECK: Punctuation: ";" [20:8 - 20:9] UnexposedStmt= +// CHECK: Punctuation: "}" [21:1 - 21:2] UnexposedStmt= |