@@ -6694,6 +6694,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
object. Make a note of this fact by marking the CONSTRUCTOR
TREE_READONLY. */
if (TREE_CODE (t) == INIT_EXPR
+ && !empty_base
&& TREE_CODE (*valp) == CONSTRUCTOR
&& TYPE_READONLY (type))
{
new file mode 100644
@@ -0,0 +1,19 @@
+// PR c++/112439
+// { dg-do compile { target c++14 } }
+
+struct Empty {};
+
+class Foo {
+public:
+ constexpr Foo(int x, Empty y, int z) : a(x), b(y)
+ {
+ c = z;
+ }
+
+private:
+ int a{};
+ [[no_unique_address]] Empty b{};
+ [[no_unique_address]] int c{};
+};
+
+constexpr Foo r{1, {}, 3};