erikjv updated this revision to Diff 117975.
erikjv added a comment.

Added more context to the diff


https://reviews.llvm.org/D38615

Files:
  test/Index/annotate-tokens-unexposed.cpp
  tools/libclang/CIndex.cpp


Index: tools/libclang/CIndex.cpp
===================================================================
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -1772,7 +1772,7 @@
 
 bool CursorVisitor::VisitAttributes(Decl *D) {
   for (const auto *I : D->attrs())
-    if (Visit(MakeCXCursor(I, D, TU)))
+    if (!I->isImplicit() && Visit(MakeCXCursor(I, D, TU)))
         return true;
 
   return false;
Index: test/Index/annotate-tokens-unexposed.cpp
===================================================================
--- /dev/null
+++ test/Index/annotate-tokens-unexposed.cpp
@@ -0,0 +1,20 @@
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:16:1 %s -target 
x86_64-pc-windows-msvc | FileCheck %s
+class Foo
+{
+public:
+    void step(int v);
+    Foo();
+};
+
+void bar()
+{
+    // Introduce a MSInheritanceAttr node on the CXXRecordDecl for Foo. The
+    // existance of this attribute should not mark all cursors for tokens in
+    // Foo as UnexposedAttr.
+    &Foo::step;
+}
+
+Foo::Foo()
+{}
+
+// CHECK-NOT: UnexposedAttr=


Index: tools/libclang/CIndex.cpp
===================================================================
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -1772,7 +1772,7 @@
 
 bool CursorVisitor::VisitAttributes(Decl *D) {
   for (const auto *I : D->attrs())
-    if (Visit(MakeCXCursor(I, D, TU)))
+    if (!I->isImplicit() && Visit(MakeCXCursor(I, D, TU)))
         return true;
 
   return false;
Index: test/Index/annotate-tokens-unexposed.cpp
===================================================================
--- /dev/null
+++ test/Index/annotate-tokens-unexposed.cpp
@@ -0,0 +1,20 @@
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:16:1 %s -target x86_64-pc-windows-msvc | FileCheck %s
+class Foo
+{
+public:
+    void step(int v);
+    Foo();
+};
+
+void bar()
+{
+    // Introduce a MSInheritanceAttr node on the CXXRecordDecl for Foo. The
+    // existance of this attribute should not mark all cursors for tokens in
+    // Foo as UnexposedAttr.
+    &Foo::step;
+}
+
+Foo::Foo()
+{}
+
+// CHECK-NOT: UnexposedAttr=
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to