InitializedEntity Entity = InitializedEntity::InitializeParameter(Param);
InitializationKind Kind = InitializationKind::CreateCopy(Param->getLocation(),
EqualLoc);
- if (CheckInitializerTypes(Arg, ParamType, Entity, Kind))
+ InitializationSequence InitSeq(*this, Entity, Kind, &Arg, 1);
+ OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
+ MultiExprArg(*this, (void**)&Arg, 1));
+ if (Result.isInvalid())
return true;
+ Arg = Result.takeAs<Expr>();
Arg = MaybeCreateCXXExprWithTemporaries(Arg);
int n);// expected-error {{missing default argument on parameter 'n'}}
struct S { } s;
-void i(int = s) { } // expected-error {{incompatible type}}
+void i(int = s) { } // expected-error {{no viable conversion}}
struct X {
X(int);
// PR5283
namespace PR5283 {
template<typename T> struct A {
- A(T = 1); // expected-error 3 {{incompatible type initializing 'int', expected 'int *'}}
+ A(T = 1); // expected-error 3 {{cannot initialize a parameter of type 'int *' with an rvalue of type 'int'}}
};
struct B : A<int*> {