RParenLoc);
}
-static CXXBaseOrMemberInitializer *
+static bool
BuildImplicitBaseInitializer(Sema &SemaRef,
const CXXConstructorDecl *Constructor,
CXXBaseSpecifier *BaseSpec,
- bool IsInheritedVirtualBase) {
+ bool IsInheritedVirtualBase,
+ CXXBaseOrMemberInitializer *&CXXBaseInit) {
InitializedEntity InitEntity
= InitializedEntity::InitializeBase(SemaRef.Context, BaseSpec,
IsInheritedVirtualBase);
BaseInit = SemaRef.MaybeCreateCXXExprWithTemporaries(move(BaseInit));
if (BaseInit.isInvalid())
- return 0;
+ return true;
- CXXBaseOrMemberInitializer *CXXBaseInit =
+ CXXBaseInit =
new (SemaRef.Context) CXXBaseOrMemberInitializer(SemaRef.Context,
SemaRef.Context.getTrivialTypeSourceInfo(BaseSpec->getType(),
SourceLocation()),
BaseInit.takeAs<Expr>(),
SourceLocation());
- return CXXBaseInit;
+ return false;
}
bool
AllToInit.push_back(Value);
} else if (!AnyErrors) {
bool IsInheritedVirtualBase = !DirectVBases.count(VBase);
- CXXBaseOrMemberInitializer *CXXBaseInit =
- BuildImplicitBaseInitializer(*this, Constructor, VBase,
- IsInheritedVirtualBase);
-
- if (!CXXBaseInit) {
+ CXXBaseOrMemberInitializer *CXXBaseInit;
+ if (BuildImplicitBaseInitializer(*this, Constructor, VBase,
+ IsInheritedVirtualBase, CXXBaseInit)) {
HadError = true;
continue;
}
= AllBaseFields.lookup(Base->getType()->getAs<RecordType>())) {
AllToInit.push_back(Value);
} else if (!AnyErrors) {
- CXXBaseOrMemberInitializer *CXXBaseInit =
- BuildImplicitBaseInitializer(*this, Constructor, Base,
- /*IsInheritedVirtualBase=*/false);
-
- if (!CXXBaseInit) {
+ CXXBaseOrMemberInitializer *CXXBaseInit;
+ if (BuildImplicitBaseInitializer(*this, Constructor, Base,
+ /*IsInheritedVirtualBase=*/false,
+ CXXBaseInit)) {
HadError = true;
continue;
}
continue;
}
- if ((*Field)->getType()->isDependentType() || AnyErrors)
+ if (AnyErrors)
continue;
QualType FT = Context.getBaseElementType((*Field)->getType());
HadError = true;
continue;
}
-
- // Don't attach synthesized member initializers in a dependent
- // context; they'll be regenerated a template instantiation
- // time.
- if (CurContext->isDependentContext())
- continue;
-
+
CXXBaseOrMemberInitializer *Member =
new (Context) CXXBaseOrMemberInitializer(Context,
*Field, SourceLocation(),