* constexpr.c (cxx_eval_component_reference): Don't complain about
unevaluated empty classes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233716
138bc75d-0d04-0410-961f-
82ee72b054a4
2016-02-25 Jason Merrill <jason@redhat.com>
+ PR c++/67364
+ * constexpr.c (cxx_eval_component_reference): Don't complain about
+ unevaluated empty classes.
+
PR c++/68049
* tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
return t;
}
- if (CONSTRUCTOR_NO_IMPLICIT_ZERO (whole))
+ if (CONSTRUCTOR_NO_IMPLICIT_ZERO (whole)
+ && !is_empty_class (TREE_TYPE (part)))
{
/* 'whole' is part of the aggregate initializer we're currently
building; if there's no initializer for this member yet, that's an
--- /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 { };
+constexpr closure<empty> tup{};
+constexpr empty first = tup.member;