aboutsummaryrefslogtreecommitdiff
path: root/test/Index/annotate-tokens-with-default-args.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-30 17:23:26 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-30 17:23:26 +0000
commit0bfe83b5a98ce37bf3a10274bca6f93ca4cb9696 (patch)
tree1b9d37e9896814a97bde0112a0baf01f2fd579f8 /test/Index/annotate-tokens-with-default-args.cpp
parentf78c4e57122dad4430329135b966dfc241a6425b (diff)
[libclang] Annotation of parameters that got default args from a previous declarations was
broken because the end location of the parameter was the end location of the default arg, resulting in a source range that could begin in one file and end in another. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/annotate-tokens-with-default-args.cpp')
-rw-r--r--test/Index/annotate-tokens-with-default-args.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Index/annotate-tokens-with-default-args.cpp b/test/Index/annotate-tokens-with-default-args.cpp
new file mode 100644
index 0000000000..2c8844156f
--- /dev/null
+++ b/test/Index/annotate-tokens-with-default-args.cpp
@@ -0,0 +1,16 @@
+#include "annotate-tokens-with-default-args.h"
+
+void Foo::m(Foo *f) {}
+
+// RUN: c-index-test -test-annotate-tokens=%s:3:1:4:1 %s | FileCheck %s
+// CHECK: Keyword: "void" [3:1 - 3:5] CXXMethod=m:3:11 (Definition)
+// CHECK: Identifier: "Foo" [3:6 - 3:9] TypeRef=struct Foo:1:8
+// CHECK: Punctuation: "::" [3:9 - 3:11] CXXMethod=m:3:11 (Definition)
+// CHECK: Identifier: "m" [3:11 - 3:12] CXXMethod=m:3:11 (Definition)
+// CHECK: Punctuation: "(" [3:12 - 3:13] CXXMethod=m:3:11 (Definition)
+// CHECK: Identifier: "Foo" [3:13 - 3:16] TypeRef=struct Foo:1:8
+// CHECK: Punctuation: "*" [3:17 - 3:18] ParmDecl=f:3:18 (Definition)
+// CHECK: Identifier: "f" [3:18 - 3:19] ParmDecl=f:3:18 (Definition)
+// CHECK: Punctuation: ")" [3:19 - 3:20] CXXMethod=m:3:11 (Definition)
+// CHECK: Punctuation: "{" [3:21 - 3:22] UnexposedStmt=
+// CHECK: Punctuation: "}" [3:22 - 3:23] UnexposedStmt=