Debian Codegraph @

gcc/testsuite/g++.dg/expr/cond12.C

raw
1 // PR c++/58714
2 // { dg-do run }
3
4 struct X {
5 X& operator=(const X&);
6 X& operator=(X&){__builtin_abort();}
7 };
8
9 X g;
10 X& X::operator=(const X&)
11 {
12 return g;
13 }
14
15 int main(int argv,char**) {
16 X a, b;
17 ((argv > 2) ? a : b) = X();
18 }