From: Argyrios Kyrtzidis Date: Fri, 21 Apr 2017 05:42:40 +0000 (+0000) Subject: [index] For 'transparent' tag typedefs, ignore their tag reference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4802bbed82dedaca155c62f3c6c10bfa25fea3aa;p=clang [index] For 'transparent' tag typedefs, ignore their tag reference git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300948 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Index/IndexDecl.cpp b/lib/Index/IndexDecl.cpp index 0e89350551..9bf19270e8 100644 --- a/lib/Index/IndexDecl.cpp +++ b/lib/Index/IndexDecl.cpp @@ -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; } diff --git a/test/Index/Core/index-source.m b/test/Index/Core/index-source.m index f48891417f..a2eef89dee 100644 --- a/test/Index/Core/index-source.m +++ b/test/Index/Core/index-source.m @@ -353,7 +353,8 @@ typedef MyGenCls 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,