summaryrefslogtreecommitdiffstats
path: root/test/Index/get-cursor.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-16 23:49:15 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-16 23:49:15 +0000
commit5641b0d02563840c51c33b93dc663c55306093f3 (patch)
tree0d46cbef982b95161251045b15304b6c4c20b8fd /test/Index/get-cursor.cpp
parent189373170330e3d551bdb28c9762d606f3bcb931 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/get-cursor.cpp')
-rw-r--r--test/Index/get-cursor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Index/get-cursor.cpp b/test/Index/get-cursor.cpp
index e1e6835bec..8b70216dd1 100644
--- a/test/Index/get-cursor.cpp
+++ b/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])