forked from OSchip/llvm-project
Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the board. llvm-svn: 81100
This commit is contained in:
parent
f87be558cf
commit
94bcae46d5
|
@ -403,8 +403,6 @@ CXXConstructExpr::CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T,
|
||||||
Args = new (C) Stmt*[NumArgs];
|
Args = new (C) Stmt*[NumArgs];
|
||||||
for (unsigned i = 0; i < numargs; ++i)
|
for (unsigned i = 0; i < numargs; ++i)
|
||||||
Args[i] = args[i];
|
Args[i] = args[i];
|
||||||
for (unsigned i = numargs; i < NumArgs; ++i)
|
|
||||||
Args[0] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2899,8 +2899,8 @@ bool Sema::InitializeVarWithConstructor(VarDecl *VD,
|
||||||
QualType DeclInitType,
|
QualType DeclInitType,
|
||||||
Expr **Exprs, unsigned NumExprs) {
|
Expr **Exprs, unsigned NumExprs) {
|
||||||
OwningExprResult TempResult =
|
OwningExprResult TempResult =
|
||||||
BuildCXXConstructExpr(VD->getLocation(), DeclInitType, Constructor,
|
BuildCXXConstructExpr(/*FIXME: ConstructLoc*/ SourceLocation(),
|
||||||
Exprs, NumExprs);
|
DeclInitType, Constructor, Exprs, NumExprs);
|
||||||
if (TempResult.isInvalid())
|
if (TempResult.isInvalid())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ void g() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> struct F {
|
template<typename T> struct F {
|
||||||
F(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}}
|
F(T t = 10);
|
||||||
void 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'}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,9 +34,6 @@ void g2() {
|
||||||
void g3(F<int> f, F<struct S> s) {
|
void g3(F<int> f, F<struct S> s) {
|
||||||
f.f();
|
f.f();
|
||||||
s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}}
|
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 {
|
template<typename T> struct G {
|
||||||
|
|
Loading…
Reference in New Issue