aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index de96be3..8f19647 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2979,7 +2979,13 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
mark_referenced (DECL_ASSEMBLER_NAME (decl));
if (TREE_CODE (decl) == TYPE_DECL)
- rest_of_decl_compilation (decl, NULL, DECL_FILE_SCOPE_P (decl), 0);
+ {
+ if (!DECL_FILE_SCOPE_P (decl)
+ && variably_modified_type_p (TREE_TYPE (decl)))
+ add_decl_stmt (decl);
+
+ rest_of_decl_compilation (decl, NULL, DECL_FILE_SCOPE_P (decl), 0);
+ }
/* At the end of a declaration, throw away any variable type sizes
of types defined inside that declaration. There is no use