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
PR c++/86728 - C variadic generic lambda.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
initlist90.C
blob
330517af697832ca211c7848e68a410e441cf74c
1
// PR c++/57510
2
// { dg-do run { target c++11 } }
3
4
#include <initializer_list>
5
6
struct counter
7
{
8
static int n;
9
10
counter() { ++n; }
11
counter(const counter&) { ++n; }
12
~counter() { --n; }
13
};
14
15
int counter::n = 0;
16
17
struct X
18
{
19
X () { if (counter::n > 1) throw 1; }
20
21
counter c;
22
};
23
24
int main ()
25
{
26
try
27
{
28
auto x = { X{}, X{} };
29
}
30
catch (...)
31
{
32
if ( counter::n != 0 )
33
throw;
34
}
35
}