This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) array tweak
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C++) array tweak
- From: Jason Merrill <jason at redhat dot com>
- Date: Tue, 12 Sep 2000 17:48:04 -0700
The comment was a holdover from C semantics, and no longer matched the
actual code. Simplified.
2000-09-12 Jason Merrill <jason@redhat.com>
* decl.c (maybe_deduce_size_from_array_init): Set do_default for
all non-extern arrays.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.688
diff -c -p -r1.688 decl.c
*** decl.c 2000/09/11 01:50:48 1.688
--- decl.c 2000/09/13 00:49:15
*************** maybe_deduce_size_from_array_init (decl,
*** 7684,7695 ****
&& TYPE_DOMAIN (type) == NULL_TREE
&& TREE_CODE (decl) != TYPE_DECL)
{
! int do_default
! = (TREE_STATIC (decl)
! /* Even if pedantic, an external linkage array
! may have incomplete type at first. */
! ? pedantic && ! DECL_EXTERNAL (decl)
! : !DECL_EXTERNAL (decl));
tree initializer = init ? init : DECL_INITIAL (decl);
int failure = complete_array_type (type, initializer, do_default);
--- 7684,7692 ----
&& TYPE_DOMAIN (type) == NULL_TREE
&& TREE_CODE (decl) != TYPE_DECL)
{
! /* do_default is really a C-ism to deal with tentative definitions.
! But let's leave it here to ease the eventual merge. */
! int do_default = !DECL_EXTERNAL (decl);
tree initializer = init ? init : DECL_INITIAL (decl);
int failure = complete_array_type (type, initializer, do_default);