Commit 7ac37b96 by Paolo Carlini Committed by Paolo Carlini

re PR c++/51621 ([c++0x] [4.6/4.7 Regression] ICE with invalid constexpr and array class member)

/cp
2011-12-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51621
	* tree.c (diagnose_non_constexpr_vec_init): For value initialization
	pass void_type_node, not void_zero_node, to build_vec_init_elt.

/testsuite
2011-12-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51621
	* g++.dg/cpp0x/constexpr-ice5.C: New.

From-SVN: r182556
parent a0c8d0c1
2011-12-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51621
* tree.c (diagnose_non_constexpr_vec_init): For value initialization
pass void_type_node, not void_zero_node, to build_vec_init_elt.
2011-12-20 Dodji Seketeli <dodji@redhat.com> 2011-12-20 Dodji Seketeli <dodji@redhat.com>
PR debug/49951 PR debug/49951
......
...@@ -564,7 +564,7 @@ diagnose_non_constexpr_vec_init (tree expr) ...@@ -564,7 +564,7 @@ diagnose_non_constexpr_vec_init (tree expr)
tree type = TREE_TYPE (VEC_INIT_EXPR_SLOT (expr)); tree type = TREE_TYPE (VEC_INIT_EXPR_SLOT (expr));
tree init, elt_init; tree init, elt_init;
if (VEC_INIT_EXPR_VALUE_INIT (expr)) if (VEC_INIT_EXPR_VALUE_INIT (expr))
init = void_zero_node; init = void_type_node;
else else
init = VEC_INIT_EXPR_INIT (expr); init = VEC_INIT_EXPR_INIT (expr);
......
2011-12-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51621
* g++.dg/cpp0x/constexpr-ice5.C: New.
2011-12-20 Joseph Myers <joseph@codesourcery.com> 2011-12-20 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c, * gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c,
......
// PR c++/51621
// { dg-options -std=c++0x }
struct A
{
A() {}
};
struct B
{
A a[1];
constexpr B() : a() {} // { dg-error "non-constant|non-constexpr" }
};
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