re PR c++/51416 ([c++0x] [4.6/4.7 Regression] ICE with invalid use of auto)

PR c++/51416
	* init.c (build_value_init_noctor): Check for incomplete type.

From-SVN: r182435
This commit is contained in:
Jason Merrill 2011-12-17 08:51:51 -05:00
parent bc958632e5
commit 46a76d4b78

View File

@ -377,6 +377,12 @@ build_value_init (tree type, tsubst_flags_t complain)
tree
build_value_init_noctor (tree type, tsubst_flags_t complain)
{
if (!COMPLETE_TYPE_P (type))
{
if (complain & tf_error)
error ("value-initialization of incomplete type %qT", type);
return error_mark_node;
}
/* FIXME the class and array cases should just use digest_init once it is
SFINAE-enabled. */
if (CLASS_TYPE_P (type))