diff options
author | Jason Merrill <jason@redhat.com> | 2012-12-14 15:57:55 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-12-14 15:57:55 -0500 |
commit | 8b299be64a9f9ba67a33c16f16302e77917afa62 (patch) | |
tree | b65cfd7d5110c6bb640bc7830d9781948be9bbff /gcc/cp/decl.c | |
parent | 5e3b173a79af6dbf3485cb08083e020633cd9f9f (diff) | |
download | gcc-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/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 3 |
1 files changed, 0 insertions, 3 deletions
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; } } |