clang/test/SemaCXX/PR113855.cpp
raw| 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | struct S {}; |
| 4 | |
| 5 | union U { |
| 6 | S x; |
| 7 | float y; |
| 8 | }; |
| 9 | |
| 10 | void f() { |
| 11 | new U{0,.y=1}; |
| 12 | // expected-warning@-1 {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}} |
| 13 | // expected-note@-2 {{first non-designated initializer is here}} |
| 14 | // expected-error@-3 {{initializer for aggregate with no elements requires explicit braces}} |
| 15 | } |