Commit fe69277d by Jason Merrill Committed by Jason Merrill

re PR c++/68890 (ICE in verify_ctor_sanity, at cp/constexpr.c:2113)

	PR c++/68890

	* constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.

From-SVN: r233430
parent e8444ca6
2016-02-15 Jason Merrill <jason@redhat.com>
PR c++/68890
* constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/69098
......
......@@ -2202,7 +2202,8 @@ verify_ctor_sanity (const constexpr_ctx *ctx, tree type)
gcc_assert (ctx->ctor);
gcc_assert (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (ctx->ctor)));
gcc_assert (CONSTRUCTOR_NELTS (ctx->ctor) == 0);
/* We used to check that ctx->ctor was empty, but that isn't the case when
the object is zero-initialized before calling the constructor. */
if (ctx->object)
gcc_assert (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (ctx->object)));
......
// PR c++/68890
// { dg-do compile { target c++11 } }
class ptr;
template <long _Nm> struct A { typedef ptr _Type[_Nm]; };
template <long _Nm> struct B { typename A<_Nm>::_Type _M_elems; };
template <long N> class FixedVector : B<N> {
public:
typedef B<1> base;
constexpr FixedVector() : base(), size_() {}
char size_;
};
class ptr {
public:
constexpr ptr() : px_(){};
int px_;
};
FixedVector<1> a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment