[cfe-commits] r81100 - in /cfe/trunk: lib/AST/ExprCXX.cpp lib/Sema/SemaDeclCXX.cpp test/SemaTemplate/default-expr-arguments.cpp
Daniel Dunbar
daniel at zuster.org
Sat Sep 5 18:31:23 PDT 2009
Author: ddunbar
Date: Sat Sep 5 20:31:23 2009
New Revision: 81100
URL: http://llvm.org/viewvc/llvm-project?rev=81100&view=rev
Log:
Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the
board.
Modified:
cfe/trunk/lib/AST/ExprCXX.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp
Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=81100&r1=81099&r2=81100&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Sat Sep 5 20:31:23 2009
@@ -403,8 +403,6 @@
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;
}
}
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=81100&r1=81099&r2=81100&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Sep 5 20:31:23 2009
@@ -2899,8 +2899,8 @@
QualType DeclInitType,
Expr **Exprs, unsigned NumExprs) {
OwningExprResult TempResult =
- BuildCXXConstructExpr(VD->getLocation(), DeclInitType, Constructor,
- Exprs, NumExprs);
+ BuildCXXConstructExpr(/*FIXME: ConstructLoc*/ SourceLocation(),
+ DeclInitType, Constructor, Exprs, NumExprs);
if (TempResult.isInvalid())
return true;
Modified: cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp?rev=81100&r1=81099&r2=81100&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp (original)
+++ cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp Sat Sep 5 20:31:23 2009
@@ -20,7 +20,7 @@
}
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'}}
};
@@ -34,9 +34,6 @@
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 {
More information about the cfe-commits
mailing list