New testcase. Unfortunately, native GCC gets this wrong. Someday we will have to figure out how to deal with this.

llvm-svn: 8162
This commit is contained in:
Chris Lattner 2003-08-27 18:19:53 +00:00
parent 7d5b6526bb
commit 9ffbb367a4
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
/* Test for throwing an exception from the copy ctor of the exception object
* invoked while building an exception.
*/
#include <stdio.h>
struct foo {
foo() {}
foo(const foo &F) { throw 1; }
};
int main() {
try {
foo f;
throw f;
} catch (int i) {
printf("Success!\n");
return 0;
} catch (foo &f) {
printf("Failure: caught a foo!\n");
return 1;
} catch (...) {
printf("Failure: caught something else!\n");
return 1;
}
}