diff options
author | Anders Carlsson <andersca@mac.com> | 2009-03-10 17:07:44 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-03-10 17:07:44 +0000 |
commit | 0275115f665a440111e62a3dcbae46989b254b4b (patch) | |
tree | 0c0730f330f026816cf3998f4b51a0c73a2ace30 /clang/lib/Sema | |
parent | 9a9a4228865dade4ffc8440b45e0ec66f58af6f7 (diff) | |
download | bcm5719-llvm-0275115f665a440111e62a3dcbae46989b254b4b.tar.gz bcm5719-llvm-0275115f665a440111e62a3dcbae46989b254b4b.zip |
Address Doug's comments wrt the mangler and fix Eli's test case
llvm-svn: 66549
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index fbdab591c3a..049c9394526 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2867,6 +2867,16 @@ TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T, D.getIdentifierLoc(), D.getIdentifier(), T); + + if (TagType *TT = dyn_cast<TagType>(T)) { + TagDecl *TD = TT->getDecl(); + + // If the TagDecl that the TypedefDecl points to is an anonymous decl + // keep track of the TypedefDecl. + if (!TD->getIdentifier() && !TD->getTypedefForAnonDecl()) + TD->setTypedefForAnonDecl(NewTD); + } + NewTD->setNextDeclarator(LastDeclarator); if (D.getInvalidType()) NewTD->setInvalidDecl(); |