aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-10 17:07:44 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-10 17:07:44 +0000
commit4843e584b54460973b8445d38907bab0401ebb0c (patch)
tree80cd1853ab6b65f189d9a6151350f457a720da20 /lib/Sema/SemaDecl.cpp
parenta5a10c37a02ac65f88624a29d1f7ad1d196fc7ea (diff)
Address Doug's comments wrt the mangler and fix Eli's test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index fbdab591c3..049c939452 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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();