Args = new (C) Stmt*[NumArgs];
for (unsigned i = 0; i < numargs; ++i)
Args[i] = args[i];
+ for (unsigned i = numargs; i < NumArgs; ++i)
+ Args[0] = 0;
}
}
QualType DeclInitType,
Expr **Exprs, unsigned NumExprs) {
OwningExprResult TempResult =
- BuildCXXConstructExpr(/*FIXME: ConstructLoc*/ SourceLocation(),
- DeclInitType, Constructor, Exprs, NumExprs);
+ BuildCXXConstructExpr(VD->getLocation(), DeclInitType, Constructor,
+ Exprs, NumExprs);
if (TempResult.isInvalid())
return true;
}
template<typename T> struct F {
- F(T t = 10);
+ F(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}}
void f(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}}
};
void g3(F<int> f, F<struct S> s) {
f.f();
s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}}
+
+ F<int> f2;
+ F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<struct S>' required here}}
}
template<typename T> struct G {