PR c++/67364
* constexpr.c (cxx_eval_component_reference): Just return an empty
CONSTRUCTOR for an empty class.
From-SVN: r233945
+2016-03-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/67364
+ * constexpr.c (cxx_eval_component_reference): Just return an empty
+ CONSTRUCTOR for an empty class.
+
2016-03-01 Jason Merrill <jason@redhat.com>
PR c++/70036
}
if (CONSTRUCTOR_NO_IMPLICIT_ZERO (whole)
- && !is_empty_class (TREE_TYPE (part)))
+ && !is_really_empty_class (TREE_TYPE (t)))
{
/* 'whole' is part of the aggregate initializer we're currently
building; if there's no initializer for this member yet, that's an
- error. */
+ error. But expand_aggr_init_1 doesn't bother to initialize really
+ empty classes, so ignore them here, too. */
if (!ctx->quiet)
error ("accessing uninitialized member %qD", part);
*non_constant_p = true;
--- /dev/null
+// PR c++/67364
+// { dg-do compile { target c++11 } }
+
+template <typename Xn>
+struct element : Xn {
+ constexpr element() : Xn() { }
+};
+
+template <typename Xn>
+struct closure {
+ element<Xn> member;
+ constexpr closure() { }
+};
+
+struct empty { struct {} s; };
+constexpr closure<empty> tup{};
+constexpr empty first = tup.member;