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
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
temporary8.C
blob
bb0698e2e3c88a0f42f7c795c2b06a728f6bf582
1
// Test for proper handling of temporaries in ?: exprs.
2
3
extern "C" int printf (const char *, ...);
4
int c = 0, d = 0;
5
6
class A {
7
public:
8
A() { ++c; }
9
A(const A&) { ++c; }
10
~A() { ++d; }
11
};
12
13
A f (const A& a)
14
{
15
return (c ? A() : A());
16
}
17
18
int main()
19
{
20
{
21
f (c ? A() : A());
22
}
23
printf ("%d %d\n", c, d);
24
return c != d || c != 2;
25
}