For templates, fields can have incomplete types:
template <class T>
struct A2 {
struct B;
B b;
};
Don't try to touch the DefinitionData of those fields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261301
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!Field->hasInClassInitializer() && !Field->isMutable()) {
if (CXXRecordDecl *FieldType = Field->getType()->getAsCXXRecordDecl()) {
- if (!FieldType->allowConstDefaultInit())
+ if (FieldType->hasDefinition() && !FieldType->allowConstDefaultInit())
data().HasUninitializedFields = true;
} else {
data().HasUninitializedFields = true;