| Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm-only %s |
| Anders Carlsson | 8c12506 | 2009-09-15 16:36:17 +0000 | [diff] [blame] | 2 | void f(bool flag) { |
| 3 | int a = 1; | ||||
| 4 | int b = 2; | ||||
| 5 | |||||
| 6 | (flag ? a : b) = 3; | ||||
| 7 | } | ||||
| John McCall | 4418439 | 2011-08-26 07:31:35 +0000 | [diff] [blame] | 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 | } | ||||