From: Jason Merrill Date: Sat, 17 Dec 2011 13:51:51 +0000 (-0500) Subject: re PR c++/51416 ([c++0x] [4.6/4.7 Regression] ICE with invalid use of auto) X-Git-Tag: releases/gcc-4.7.0~1470 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46a76d4b7880ea2ff569b09aa80a07ce5355f645;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 98a80e396622..2355a04de231 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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))