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
d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
temporary3.C
blob
7d96386b705583b4de0eb713f01225cb03d2e7f2
1
// { dg-do run }
2
// Bug: the temporary returned from f is elided, causing a to be constructed
3
// twice but only destroyed once.
4
5
extern "C" int printf (const char *, ...);
6
7
int c,d;
8
9
struct A {
10
A (int) { c++; }
11
~A () { d++; }
12
A (const A&) { c++; }
13
int i;
14
};
15
16
A f ()
17
{ return 1; }
18
19
int main ()
20
{
21
{
22
A a (1);
23
a = f ();
24
}
25
printf ("%d %d\n", c, d);
26
return c != d;
27
}