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
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1z
/
elide2.C
blob
277decff48777fee30b88f92aa8b9da6ba4461bd
1
// DR 1697
2
// { dg-do run { target c++11 } }
3
4
#define assert(X) do { if (!(X)) __builtin_abort(); } while(0)
5
6
int i;
7
struct S {
8
~S() { assert (i++ == 2); }
9
};
10
struct X {
11
X() { assert (i++ == 0); }
12
X(const X&);
13
};
14
struct T {
15
S &&s;
16
X x;
17
};
18
void f() { assert (i++ == 1); }
19
int main() {
20
{
21
T t = T{ {}, {} };
22
f();
23
}
24
assert (i == 3);
25
}