summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-15 06:14:58 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-15 06:14:58 +0000
commit15a7c3394c85f2b2b73da6f83c38d96eafa4c106 (patch)
tree29093ff129ab0cfa018b3056257ef5fd1c305733 /gcc/cp
parent0e9aa9fe90964354e16a92b03ce03879877fbc41 (diff)
downloadgcc-15a7c3394c85f2b2b73da6f83c38d96eafa4c106.tar.gz
* decl.c (layout_var_decl): Call layout_decl even for variables
whose type is an array with unspecified bounds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58149 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e5c7356e5af..8abfb731327 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2002-10-14 Mark Mitchell <mark@codesourcery.com>
+ * decl.c (layout_var_decl): Call layout_decl even for variables
+ whose type is an array with unspecified bounds.
+
PR c++/7176
* lex.c (do_identifier): Add another option for the parsing
parameter.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4401954adcb..d122dfbe3be 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7617,7 +7617,11 @@ layout_var_decl (decl)
`extern X x' for some incomplete type `X'.) */
if (!DECL_EXTERNAL (decl))
complete_type (type);
- if (!DECL_SIZE (decl) && COMPLETE_TYPE_P (type))
+ if (!DECL_SIZE (decl)
+ && (COMPLETE_TYPE_P (type)
+ || (TREE_CODE (type) == ARRAY_TYPE
+ && !TYPE_DOMAIN (type)
+ && COMPLETE_TYPE_P (TREE_TYPE (type)))))
layout_decl (decl, 0);
if (!DECL_EXTERNAL (decl) && DECL_SIZE (decl) == NULL_TREE)