Backported from mainline
2018-12-07 Jakub Jelinek <jakub@redhat.com>
PR c++/87506
* constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR.
* g++.dg/cpp0x/constexpr-87506.C: New test.
From-SVN: r275075
2019-08-30 Jakub Jelinek <jakub@redhat.com>
-
+
Backported from mainline
+ 2018-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87506
+ * constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR.
+
2018-12-04 Jakub Jelinek <jakub@redhat.com>
PR c++/88103
/* Avoid wrapping an aggregate value in a NOP_EXPR. */
if (TREE_CODE (temp) == CONSTRUCTOR)
return build_constructor (type, CONSTRUCTOR_ELTS (temp));
+ if (TREE_CODE (temp) == EMPTY_CLASS_EXPR)
+ return build0 (EMPTY_CLASS_EXPR, type);
gcc_assert (scalarish_type_p (type));
return cp_fold_convert (type, temp);
}
2019-08-30 Jakub Jelinek <jakub@redhat.com>
-
+
Backported from mainline
+ 2018-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87506
+ * g++.dg/cpp0x/constexpr-87506.C: New test.
+
2018-12-04 Jakub Jelinek <jakub@redhat.com>
PR c++/88103
--- /dev/null
+// PR c++/87506
+// { dg-do compile { target c++11 } }
+
+struct A {};
+struct B { constexpr B (const A) {} };
+struct C : B { using B::B; };
+
+void
+foo ()
+{
+ C c (A{});
+}