diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-16 23:49:15 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-16 23:49:15 +0000 |
commit | fbb2bb5a3dc235e39ae67763c70845f9b3d5b545 (patch) | |
tree | a04d09016eecbdae9853182b540892a8464bc7b6 /clang/test/Index/get-cursor.cpp | |
parent | 06fd3c61be11db14c6855694a1f1f00c0ecabc5a (diff) | |
download | bcm5719-llvm-fbb2bb5a3dc235e39ae67763c70845f9b3d5b545.tar.gz bcm5719-llvm-fbb2bb5a3dc235e39ae67763c70845f9b3d5b545.zip |
[libclang/AST] When declaring a local class, don't neglect to set the end location
of the DeclStmt node, otherwise libclang will not work for anything inside that
class.
rdar://10837710
llvm-svn: 156966
Diffstat (limited to 'clang/test/Index/get-cursor.cpp')
-rw-r--r-- | clang/test/Index/get-cursor.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Index/get-cursor.cpp b/clang/test/Index/get-cursor.cpp index e1e6835beca..8b70216dd16 100644 --- a/clang/test/Index/get-cursor.cpp +++ b/clang/test/Index/get-cursor.cpp @@ -38,6 +38,13 @@ void test() { } catch (X e) { X x; } + + struct LocalS { + void meth() { + int x; + ++x; + } + }; } // RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s @@ -93,3 +100,6 @@ void test() { // RUN: c-index-test -test-load-source-usrs local %s | FileCheck -check-prefix=CHECK-USR %s // CHECK-USR: get-cursor.cpp c:get-cursor.cpp@472@F@test#@e Extent=[38:12 - 38:15] // CHECK-USR: get-cursor.cpp c:get-cursor.cpp@483@F@test#@x Extent=[39:5 - 39:8] + +// RUN: c-index-test -cursor-at=%s:45:9 %s | FileCheck -check-prefix=CHECK-LOCALCLASS %s +// CHECK-LOCALCLASS: 45:9 DeclRefExpr=x:44:11 Extent=[45:9 - 45:10] Spelling=x ([45:9 - 45:10]) |