Rafael Espindola | 68045b1 | 2011-12-30 03:13:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -std=c++11 -emit-llvm-only |
| 2 | // CHECK that we don't crash. |
| 3 | |
Richard Smith | 1d0c9a8 | 2012-02-14 21:14:13 +0000 | [diff] [blame] | 4 | // PR11676's example is ill-formed: |
| 5 | /* |
Rafael Espindola | 68045b1 | 2011-12-30 03:13:44 +0000 | [diff] [blame] | 6 | union _XEvent { |
| 7 | }; |
| 8 | void ProcessEvent() { |
| 9 | _XEvent pluginEvent = _XEvent(); |
| 10 | } |
Richard Smith | 1d0c9a8 | 2012-02-14 21:14:13 +0000 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | // Example from PR11665: |
| 14 | void f() { |
| 15 | union U { int field; } u = U(); |
| 16 | (void)U().field; |
| 17 | } |