re PR c++/58868 (ICE: in count_type_elements, at expr.c:5495 with -std=gnu++0x)

PR c++/58868
	* decl.c (check_initializer): Don't use build_vec_init for arrays
	of trivial type.

From-SVN: r204406
This commit is contained in:
Jason Merrill 2013-11-05 13:03:03 -05:00 committed by Jason Merrill
parent 02ac9503fd
commit 136d4b89f0
3 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-11-05 Jason Merrill <jason@redhat.com>
PR c++/58868
* decl.c (check_initializer): Don't use build_vec_init for arrays
of trivial type.
2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58724

View File

@ -5683,6 +5683,7 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
&& !(init && BRACE_ENCLOSED_INITIALIZER_P (init)
&& CP_AGGREGATE_TYPE_P (type)
&& (CLASS_TYPE_P (type)
|| !TYPE_NEEDS_CONSTRUCTING (type)
|| type_has_extended_temps (type))))
{
init_code = build_aggr_init_full_exprs (decl, init, flags);

View File

@ -0,0 +1,3 @@
// PR c++/58868
static struct { const int i; } a[] = { 1 };