Commit 14b1860e by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/51369 ([c++0x] [4.7 Regression] ICE using constexpr in template)

	PR c++/51369
	* init.c (build_value_init): Allow array types even when
	processing_template_decl.

	* g++.dg/cpp0x/constexpr-51369.C: New test.

From-SVN: r182086
parent 95c0a8a7
2011-12-07 Jakub Jelinek <jakub@redhat.com>
PR c++/51369
* init.c (build_value_init): Allow array types even when
processing_template_decl.
2011-12-07 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/51420
......
......@@ -333,7 +333,8 @@ build_value_init (tree type, tsubst_flags_t complain)
constructor. */
/* The AGGR_INIT_EXPR tweaking below breaks in templates. */
gcc_assert (!processing_template_decl || SCALAR_TYPE_P (type));
gcc_assert (!processing_template_decl
|| (SCALAR_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE));
if (CLASS_TYPE_P (type))
{
......
2011-12-07 Jakub Jelinek <jakub@redhat.com>
PR c++/51369
* g++.dg/cpp0x/constexpr-51369.C: New test.
2011-12-07 Andrew Pinski <apinski@cavium.com>
PR middle-end/45416
......
// PR c++/51369
// { dg-do compile }
// { dg-options "-std=c++11" }
constexpr int x[2][2] = {};
template<int>
void
foo ()
{
x[0][0];
}
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