diff options
Diffstat (limited to 'test/test_exception.cc')
-rw-r--r-- | test/test_exception.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_exception.cc b/test/test_exception.cc index eb738ba..44fe5d0 100644 --- a/test/test_exception.cc +++ b/test/test_exception.cc @@ -5,7 +5,7 @@ #include <exception> -#define fprintf(...) +//#define fprintf(...) void log(void* ignored) { @@ -178,6 +178,21 @@ void test_exceptions(void) catch (int64_t i) { TEST(0, "Caught int64_t, but that violates an exception spec"); } + int a; + try { + throw &a; + } + catch (const int *b) + { + TEST(&a==b, "Caught const int from thrown int"); + } + try { + throw &a; + } + catch (int *b) + { + TEST(&a==b, "Caught int from thrown int"); + } //printf("Test: %s\n", } |