blob: 84c34dd1e0a19c646531301e1bff955eca4d74d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// { dg-do run }
// { dg-options "-std=c++0x" }
// Test throw and catch
#include <cstdio>
typedef decltype(nullptr) nullptr_t;
int main()
{
try {
throw nullptr;
} catch (void*) {
printf("Test 1 Fail");
} catch (bool) {
printf("Test 1 Fail");
} catch (int) {
printf("Test 1 Fail");
} catch (long int) {
printf("Test 1 Fail");
} catch (nullptr_t) {
printf("Test 1 OK");
} catch (...) {
printf("Test 1 Fail");
} // { dg-output "Test 1 OK" }
}
|