aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 80cdcd5464..b6db829de6 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -195,6 +195,13 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
"Can't handle qualifiers on typedef names yet!");
// TypeQuals handled by caller.
Result = Context.getTypeDeclType(cast<TypeDecl>(D));
+
+ // In C++, make an ElaboratedType.
+ if (getLangOptions().CPlusPlus) {
+ TagDecl::TagKind Tag
+ = TagDecl::getTagKindForTypeSpec(DS.getTypeSpecType());
+ Result = Context.getElaboratedType(Result, Tag);
+ }
if (D->isInvalidDecl())
isInvalid = true;