/// Subclasses may override this routine to provide different behavior.
ExprResult RebuildInitList(SourceLocation LBraceLoc,
MultiExprArg Inits,
- SourceLocation RBraceLoc,
- QualType ResultTy) {
- ExprResult Result
- = SemaRef.ActOnInitList(LBraceLoc, Inits, RBraceLoc);
- if (Result.isInvalid() || ResultTy->isDependentType())
- return Result;
-
- // Patch in the result type we were given, which may have been computed
- // when the initial InitListExpr was built.
- InitListExpr *ILE = cast<InitListExpr>((Expr *)Result.get());
- ILE->setType(ResultTy);
- return Result;
+ SourceLocation RBraceLoc) {
+ return SemaRef.ActOnInitList(LBraceLoc, Inits, RBraceLoc);
}
/// \brief Build a new designated initializer expression.
/*IsCall*/true, NewArgs, &ArgChanged))
return ExprError();
- // If this was list initialization, revert to list form.
+ // If this was list initialization, revert to syntactic list form.
if (Construct->isListInitialization())
return getDerived().RebuildInitList(Construct->getLocStart(), NewArgs,
- Construct->getLocEnd(),
- Construct->getType());
+ Construct->getLocEnd());
// Build a ParenListExpr to represent anything else.
SourceRange Parens = Construct->getParenOrBraceRange();
}
return getDerived().RebuildInitList(E->getLBraceLoc(), Inits,
- E->getRBraceLoc(), E->getType());
+ E->getRBraceLoc());
}
template<typename Derived>
// A_CLEANUP:
// CHECK: call void @_ZN7Dynamic1AD1Ev({{.*}} @_ZN7Dynamic2d3E
}
+
+namespace Instantiated1 {
+ struct A { A(); };
+ struct B : A { using A::A; };
+ template<int> B v({});
+ template B v<0>;
+ // CHECK-LABEL: define {{.*}}global_var_init{{.*}} comdat($_ZN13Instantiated11vILi0EEE) {
+ // CHECK: call void @_ZN13Instantiated11BC1Ev(%{{.*}}* @_ZN13Instantiated11vILi0EEE)
+}
+
+namespace Instantiated2 {
+ struct A { A(); };
+ struct B : A {};
+ template<int> B v({});
+ template B v<0>;
+ // CHECK-LABEL: define {{.*}}global_var_init{{.*}} comdat($_ZN13Instantiated21vILi0EEE) {
+ // CHECK: call void @_ZN13Instantiated21AC2Ev(
+}