summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b8a578f9ee0..0b802ff7578 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4711,6 +4711,10 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (init && DECL_INITIAL (decl))
DECL_INITIAL (decl) = init;
+ if (TREE_CODE (decl) == VAR_DECL
+ && !DECL_PRETTY_FUNCTION_P (decl)
+ && !dependent_type_p (TREE_TYPE (decl)))
+ maybe_deduce_size_from_array_init (decl, init);
goto finish_end0;
}