aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-12-14 15:57:55 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-12-14 15:57:55 -0500
commit8b299be64a9f9ba67a33c16f16302e77917afa62 (patch)
treeb65cfd7d5110c6bb640bc7830d9781948be9bbff /gcc/cp
parent5e3b173a79af6dbf3485cb08083e020633cd9f9f (diff)
downloadgcc-8b299be64a9f9ba67a33c16f16302e77917afa62.zip
gcc-8b299be64a9f9ba67a33c16f16302e77917afa62.tar.gz
gcc-8b299be64a9f9ba67a33c16f16302e77917afa62.tar.bz2
re PR c++/42315 (ICE with invalid array initializer)
PR c++/42315 * decl.c (maybe_deduce_size_from_array_init): Don't change the variable type. From-SVN: r194509
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ea4cfb2..ee9bf77 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/42315
+ * decl.c (maybe_deduce_size_from_array_init): Don't change the
+ variable type.
+
2012-12-13 Jakub Jelinek <jakub@redhat.com>
PR c++/55652
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cdda2f4..64bd4b5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4834,14 +4834,12 @@ maybe_deduce_size_from_array_init (tree decl, tree init)
if (failure == 1)
{
error ("initializer fails to determine size of %qD", decl);
- TREE_TYPE (decl) = error_mark_node;
}
else if (failure == 2)
{
if (do_default)
{
error ("array size missing in %qD", decl);
- TREE_TYPE (decl) = error_mark_node;
}
/* If a `static' var's size isn't known, make it extern as
well as static, so it does not get allocated. If it's not
@@ -4853,7 +4851,6 @@ maybe_deduce_size_from_array_init (tree decl, tree init)
else if (failure == 3)
{
error ("zero-size array %qD", decl);
- TREE_TYPE (decl) = error_mark_node;
}
}