summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-13 22:07:44 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-13 22:07:44 +0000
commit02bc54d11c70bc539d8791d3c409bdb561dad01d (patch)
treec079f0a96e89d253e4bc02aedc3b1680e4264de0 /clang/lib/Sema
parent48d462573d8f0099ce48dcd5793ac04930a8426d (diff)
downloadbcm5719-llvm-02bc54d11c70bc539d8791d3c409bdb561dad01d.tar.gz
bcm5719-llvm-02bc54d11c70bc539d8791d3c409bdb561dad01d.zip
Don't a.k.a. through the primary typedef of an anonymous tag decl.
llvm-svn: 93362
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/Sema.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index fefe924bc46..171101bb96d 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -110,6 +110,12 @@ static bool ShouldAKA(ASTContext &Context, QualType QT,
if (isa<VectorType>(Underlying))
break;
+ // Don't desugar through the primary typedef of an anonymous type.
+ if (isa<TagType>(Underlying) && isa<TypedefType>(QT))
+ if (cast<TagType>(Underlying)->getDecl()->getTypedefForAnonDecl() ==
+ cast<TypedefType>(QT)->getDecl())
+ break;
+
// Otherwise, we're tearing through something opaque; note that
// we'll eventually need an a.k.a. clause and keep going.
AKA = true;
OpenPOWER on IntegriCloud