| 1 | // RUN: %clang_cc1 -emit-llvm-only %s |
|---|---|
| 2 | void f(bool flag) { |
| 3 | int a = 1; |
| 4 | int b = 2; |
| 5 | |
| 6 | (flag ? a : b) = 3; |
| 7 | } |
| 8 | |
| 9 | // PR10756 |
| 10 | namespace test0 { |
| 11 | struct A { |
| 12 | A(const A &); |
| 13 | A &operator=(const A &); |
| 14 | A sub() const; |
| 15 | void foo() const; |
| 16 | }; |
| 17 | void foo(bool cond, const A &a) { |
| 18 | (cond ? a : a.sub()).foo(); |
| 19 | } |
| 20 | } |
| 21 |