| // RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s |
| } // end namespace PR61118 |
| template <int val> void f() { |
| constexpr Outer x{.inner = {val}}; |
| static_assert(x.inner.a == val); |
| U1 u{.x=2, // expected-note {{previous initialization is here}} |
| .y=1}; // expected-error {{initializer partially overrides prior initialization of this subobject}} |
| new U2{.x = NonTrivial{}, // expected-note {{previous initialization is here}} |
| .y=1}; // expected-error {{initializer would partially override prior initialization of object of type 'NonTrivial' with non-trivial destruction}} |