aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2011-12-17 08:51:51 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-12-17 08:51:51 -0500
commit46a76d4b7880ea2ff569b09aa80a07ce5355f645 (patch)
treedfbf5377d6e2be2b23b416c6bdf0534e14d1be4a /gcc
parentbc958632e5e497d646ebbada08414b6a8323ff62 (diff)
downloadgcc-46a76d4b7880ea2ff569b09aa80a07ce5355f645.zip
gcc-46a76d4b7880ea2ff569b09aa80a07ce5355f645.tar.gz
gcc-46a76d4b7880ea2ff569b09aa80a07ce5355f645.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/init.c6
1 files changed, 6 insertions, 0 deletions
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))