aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaFixItUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaFixItUtils.cpp')
-rw-r--r--lib/Sema/SemaFixItUtils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaFixItUtils.cpp b/lib/Sema/SemaFixItUtils.cpp
index 1f17a9e83e..0f7530b415 100644
--- a/lib/Sema/SemaFixItUtils.cpp
+++ b/lib/Sema/SemaFixItUtils.cpp
@@ -180,9 +180,11 @@ const char *Sema::getFixItZeroInitializerForType(QualType T) const {
if (T->isScalarType())
return " = 0";
const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
- if (LangOpts.CPlusPlus0x && RD && !RD->hasUserProvidedDefaultConstructor())
+ if (!RD || !RD->hasDefinition())
+ return 0;
+ if (LangOpts.CPlusPlus0x && !RD->hasUserProvidedDefaultConstructor())
return "{}";
- if (T->isAggregateType())
+ if (RD->isAggregate())
return " = {}";
return 0;
}