diff options
author | John McCall <rjmccall@apple.com> | 2010-10-29 08:14:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-29 08:14:02 +0000 |
commit | 077dc605405e9aeacf10056976f78e5d247ff457 (patch) | |
tree | 005814f2e9d6f628eaf574e374a86648936103df | |
parent | 4af6bf1fdcdbb86c9b9258d37b3e8f6487c094ad (diff) | |
download | bcm5719-llvm-077dc605405e9aeacf10056976f78e5d247ff457.tar.gz bcm5719-llvm-077dc605405e9aeacf10056976f78e5d247ff457.zip |
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
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 2 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/throw-expressions.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 79646f3316b..cb7bad25756 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -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 diff --git a/clang/test/CodeGenCXX/throw-expressions.cpp b/clang/test/CodeGenCXX/throw-expressions.cpp index 1670e445023..f41d35ec374 100644 --- a/clang/test/CodeGenCXX/throw-expressions.cpp +++ b/clang/test/CodeGenCXX/throw-expressions.cpp @@ -8,3 +8,8 @@ int& test1() { int test2() { return val ? throw val : val; } + +// rdar://problem/8608801 +void test3() { + throw false; +} |