aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/cond12.C
blob: 90d77dbd708603548db6e8e45d2f055735019859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/58714
// { dg-do run }

struct X {
    X& operator=(const X&);
    X& operator=(X&){__builtin_abort();}
};

X g;
X& X::operator=(const X&)
{
  return g;
}

int main(int argv,char**) {
  X a, b;
  ((argv > 2) ? a : b) = X();
}