repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
eh
/
stdarg1.C
blob
d4d2cc4e359940353a7332044d1ea7f19439b4bc
1
// PR c++/72809
2
// { dg-do compile }
3
4
#include <stdarg.h>
5
6
int
7
foo (int a, ...)
8
{
9
va_list ap;
10
int r = 0;
11
va_start (ap, a);
12
try
13
{
14
if (a == 1)
15
throw (ap);
16
}
17
catch (va_list b)
18
{
19
r = va_arg (b, int);
20
}
21
va_end (ap);
22
return r;
23
}
24
25
int
26
main ()
27
{
28
if (foo (0) != 0 || foo (1, 7) != 7)
29
__builtin_abort ();
30
}