aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-12 17:40:34 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-12 17:40:34 +0000
commitb37b648b3f2bba4c557a1604ced19b526b25a372 (patch)
tree0e4777e1c739b4699f9283e5e718d5577356ca79 /lib/Sema/SemaType.cpp
parent104f45c685e5a97306aa72c79f4d068e2999db62 (diff)
Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index ceec5f226f..7911e76d44 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -930,7 +930,10 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
if (!D.isInvalidType() && D.getDeclSpec().isTypeSpecOwned()) {
TagDecl* Owned = cast<TagDecl>((Decl *)D.getDeclSpec().getTypeRep());
- Owned->setDefinedInDeclarator(Owned->isDefinition());
+ // Owned is embedded if it was defined here, or if it is the
+ // very first (i.e., canonical) declaration of this tag type.
+ Owned->setEmbeddedInDeclarator(Owned->isDefinition() ||
+ Owned->isCanonicalDecl());
if (OwnedDecl) *OwnedDecl = Owned;
}
break;