summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-09 08:13:47 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-09 08:13:47 +0000
commit4a4d2b417564a09f01b0b6db6da3b4b3705bff4c (patch)
tree9467f842d348a3d2fedbac8791b02720de938dac
parent2813e3a46e46bd13534b5357d4bc05aa97d565f6 (diff)
downloadbcm5719-llvm-4a4d2b417564a09f01b0b6db6da3b4b3705bff4c.tar.gz
bcm5719-llvm-4a4d2b417564a09f01b0b6db6da3b4b3705bff4c.zip
[libclang] While visiting a C++ destructor decl, keep the type identifier associated with the decl,
don't turn it into a type ref. rdar://15907618 llvm-svn: 201042
-rw-r--r--clang/test/Index/annotate-tokens.cpp8
-rw-r--r--clang/tools/libclang/CIndex.cpp5
2 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/Index/annotate-tokens.cpp b/clang/test/Index/annotate-tokens.cpp
index 292e49c0810..460ab51dd95 100644
--- a/clang/test/Index/annotate-tokens.cpp
+++ b/clang/test/Index/annotate-tokens.cpp
@@ -33,7 +33,11 @@ void test4() {
return;
}
-// RUN: c-index-test -test-annotate-tokens=%s:1:1:30:1 %s -fno-delayed-template-parsing | FileCheck %s
+class C {
+ ~C();
+};
+
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:38:1 %s -fno-delayed-template-parsing | 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)
@@ -178,6 +182,8 @@ void test4() {
// CHECK: Punctuation: ")" [29:19 - 29:20] CXXMethod=foo:29:15 (Definition)
// CHECK: Punctuation: "{" [29:21 - 29:22] CompoundStmt=
// CHECK: Punctuation: "}" [29:22 - 29:23] CompoundStmt=
+// CHECK: Punctuation: "~" [37:3 - 37:4] CXXDestructor=~C:37:3
+// CHECK: Identifier: "C" [37:4 - 37:5] CXXDestructor=~C:37:3
// RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-annotate-tokens=%s:32:1:32:13 %s | FileCheck %s -check-prefix=CHECK2
// CHECK2: Keyword: "if" [32:3 - 32:5] IfStmt=
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 1af4e55e093..f3ab7360b53 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -779,8 +779,9 @@ bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) {
return true;
// Visit the declaration name.
- if (VisitDeclarationNameInfo(ND->getNameInfo()))
- return true;
+ if (!isa<CXXDestructorDecl>(ND))
+ if (VisitDeclarationNameInfo(ND->getNameInfo()))
+ return true;
// FIXME: Visit explicitly-specified template arguments!
OpenPOWER on IntegriCloud