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
Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
ref7.C
blob
a7a7f8cd5d0e5643bc6bda0feeb56eb2ad3ea5cd
1
// { dg-do run }
2
// Testcase for the lifetime of a temporary object which is used to
3
// initialize a reference.
4
5
int destroyed = 0;
6
7
struct A {
8
A() { }
9
A(int) { }
10
~A() { destroyed++; }
11
};
12
13
A a;
14
A foo () { return a; }
15
16
int main()
17
{
18
const A& ar = foo();
19
const A& ar2 = A();
20
const A& ar3 = (A)1;
21
return destroyed;
22
}