From 993f6373e96c56a6c8b96c96a9473c80157855cb Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 17 Dec 2011 13:51:51 +0000 Subject: [PATCH] PR c++/51416 * init.c (build_value_init_noctor): Check for incomplete type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182435 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 98a80e3..2355a04 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)) -- 2.7.4