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
Merge from mainline.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
overload
/
cond1.C
blob
74f0f3c49e3a2dd0858040a627050d6b79eff3ef
1
// Test that converting a COND_EXPR to void doesn't result in trying to
2
// bitwise copy a class with a nontrivial copy constructor (and thus a
3
// compiler abort).
4
5
// { dg-options "-O" }
6
7
struct A {
8
virtual ~A() { }
9
};
10
11
A a1, a2;
12
inline A& one () { return a1; }
13
inline A& two () { return a2; }
14
15
inline void f (int i)
16
{
17
i ? a1 : a2;
18
i ? one() : two();
19
}
20
21
int main ()
22
{
23
f (1);
24
}