PlacementArgs, &ArgumentChanged))
return ExprError();
- // transform the constructor arguments (if any).
+ // Transform the constructor arguments (if any).
+ // As an annoying corner case, we may have introduced an implicit value-
+ // initialization expression when allocating a new array, which we implicitly
+ // drop. It will be re-created during type checking.
ASTOwningVector<Expr*> ConstructorArgs(SemaRef);
- if (TransformExprs(E->getConstructorArgs(), E->getNumConstructorArgs(), true,
+ if (!(E->isArray() && E->getNumConstructorArgs() == 1 &&
+ isa<ImplicitValueInitExpr>(E->getConstructorArgs()[0])) &&
+ TransformExprs(E->getConstructorArgs(), E->getNumConstructorArgs(), true,
ConstructorArgs, &ArgumentChanged))
return ExprError();
AllocType,
AllocTypeInfo,
ArraySize.get(),
- /*FIXME:*/E->hasInitializer()
- ? E->getLocStart()
- : SourceLocation(),
+ E->getConstructorLParen(),
move_arg(ConstructorArgs),
- /*FIXME:*/E->hasInitializer()
- ? E->getLocEnd()
- : SourceLocation());
+ E->getConstructorRParen());
}
template<typename Derived>
new X(); // expected-note{{instantiation of}}
}
};
-
+
template void Y2<3>::f();
+
+ template<typename T>
+ void rdar10283928(int count) {
+ (void)new char[count]();
+ }
+
+ template void rdar10283928<int>(int);
}
namespace PR10864 {