OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR c++/44157
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
variadic73.C
1
// { dg-do "run" }
2
// { dg-options "-std=gnu++0x" }
3
struct A {};
4
struct B {};
5
struct C {};
6
7
template<typename... Exceptions> void f(int idx) throw(Exceptions...) {
8
if (idx == 0) throw A();
9
else if (idx == 1) throw B();
10
else if (idx == 2) throw C();
11
}
12
13
extern "C" void abort();
14
15
int main()
16
{
17
try {
18
f<A, B, C>(0);
19
abort();
20
} catch (A) {
21
}
22
try {
23
f<A, B, C>(1);
24
abort();
25
} catch (B) {
26
}
27
try {
28
f<A, B, C>(2);
29
abort();
30
} catch (C) {
31
}
32
return 0;
33
}