Don't assert on attempts to throw 'bool'. I wonder if in the history of C++

anyone has ever intentionally done this outside of a compiler test case.

llvm-svn: 117645
This commit is contained in:
John McCall 2010-10-29 08:14:02 +00:00
parent 4af6bf1fdc
commit 077dc60540
2 changed files with 6 additions and 1 deletions

View File

@ -526,7 +526,7 @@ static void EmitAnyExprToExn(CodeGenFunction &CGF, const Expr *E,
// __cxa_allocate_exception returns a void*; we need to cast this
// to the appropriate type for the object.
const llvm::Type *Ty = CGF.ConvertType(E->getType())->getPointerTo();
const llvm::Type *Ty = CGF.ConvertTypeForMem(E->getType())->getPointerTo();
llvm::Value *TypedExnLoc = CGF.Builder.CreateBitCast(ExnLoc, Ty);
// FIXME: this isn't quite right! If there's a final unelided call

View File

@ -8,3 +8,8 @@ int& test1() {
int test2() {
return val ? throw val : val;
}
// rdar://problem/8608801
void test3() {
throw false;
}