]> granicus.if.org Git - clang/commitdiff
[index] For 'transparent' tag typedefs, ignore their tag reference
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 21 Apr 2017 05:42:40 +0000 (05:42 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 21 Apr 2017 05:42:40 +0000 (05:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300948 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Index/IndexDecl.cpp
test/Index/Core/index-source.m

index 0e893505516f928ccf02c6bb6e67ed13f4868f8b..9bf19270e8de3a154666d5f9a1e3f3e6a0019619 100644 (file)
@@ -231,10 +231,11 @@ public:
   }
 
   bool VisitTypedefNameDecl(const TypedefNameDecl *D) {
-    if (!D->isTransparentTag())
+    if (!D->isTransparentTag()) {
       if (!IndexCtx.handleDecl(D))
         return false;
-    IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
+      IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
+    }
     return true;
   }
 
index f48891417f5faf9117042b43d8a9a5d7100507d2..a2eef89deea7eb5593f0430c5d18b07f79caa53e 100644 (file)
@@ -353,7 +353,8 @@ typedef MyGenCls<Base *><MyEnumerating> MyEnumerator;
 
 typedef NS_ENUM(AnotherEnum, int) {
 // CHECK-NOT: [[@LINE-1]]:17 | type-alias/C | AnotherEnum |
-// CHECK: [[@LINE-2]]:17 | enum/C | AnotherEnum | [[AnotherEnum_USR:.*]] | {{.*}} | Ref,RelCont | rel: 1
+// CHECK-NOT: [[@LINE-2]]:17 | {{.*}} | Ref
+// CHECK: [[@LINE-3]]:17 | enum/C | AnotherEnum | [[AnotherEnum_USR:.*]] | {{.*}} | Def | rel: 0
   AnotherEnumFirst = 0,
   AnotherEnumSecond = 1,
   AnotherEnumThird = 2,