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++/37276
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
init
/
ref16.C
blob
2d56395cb63921412d810cf6c4710cc6f71044bf
1
// PR c++/35548
2
// { dg-do run }
3
4
int c;
5
struct A
6
{
7
A() { ++c; }
8
A(const A&) { ++c; }
9
~A() { --c; }
10
};
11
12
A f()
13
{
14
return A();
15
}
16
17
int i;
18
const A* ap;
19
int main()
20
{
21
const A& ar = i ? *ap : f();
22
return (c == 0);
23
}