public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted
@ 2004-08-03 2:32 bangerth at dealii dot org
2004-08-03 2:36 ` [Bug c++/16859] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-08-03 2:32 UTC (permalink / raw)
To: gcc-bugs
Section 8.3.1/4 states that arrays of unknown size may only be initialized
by initializer lists of size greater than zero. However, all gcc versions
I have (and a good number of other compilers, btw) accept this code:
----------------
int a[] = {};
----------------
That sounds spurious to me.
W.
--
Summary: Empty initializer for array of unknown size spuriously
accepted
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
@ 2004-08-03 2:36 ` pinskia at gcc dot gnu dot org
2005-03-03 17:07 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-03 2:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-03 02:36 -------
Confirmed.
What is really funny is that the C front-end rejects it with -pedantic-errors.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-08-03 02:36:42
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
2004-08-03 2:36 ` [Bug c++/16859] " pinskia at gcc dot gnu dot org
@ 2005-03-03 17:07 ` pinskia at gcc dot gnu dot org
2005-03-03 18:47 ` pcarlini at suse dot de
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-03 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-03 17:06 -------
I knew I should have looked for this bug.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
2004-08-03 2:36 ` [Bug c++/16859] " pinskia at gcc dot gnu dot org
2005-03-03 17:07 ` pinskia at gcc dot gnu dot org
@ 2005-03-03 18:47 ` pcarlini at suse dot de
2005-03-09 17:04 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2005-03-03 18:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-03-03 18:47 -------
Want to have a look, a fix seems easy...
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
` (2 preceding siblings ...)
2005-03-03 18:47 ` pcarlini at suse dot de
@ 2005-03-09 17:04 ` cvs-commit at gcc dot gnu dot org
2005-03-09 17:05 ` cvs-commit at gcc dot gnu dot org
2005-03-09 17:06 ` pcarlini at suse dot de
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-09 17:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-09 17:03 -------
Subject: Bug 16859
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2005-03-09 17:03:39
Modified files:
gcc/cp : ChangeLog decl.c
Log message:
2005-03-09 Paolo Carlini <pcarlini@suse.de>
PR c++/16859
* decl.c (complete_array_type): In pedantic mode, return
3 for an empty initializer list as the initializer for an
array of unknown bound (8.5.1/4).
(maybe_deduce_size_from_array_init): Fix final test to use
the above.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4656&r2=1.4657
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1375&r2=1.1376
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
` (3 preceding siblings ...)
2005-03-09 17:04 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-09 17:05 ` cvs-commit at gcc dot gnu dot org
2005-03-09 17:06 ` pcarlini at suse dot de
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-09 17:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-09 17:05 -------
Subject: Bug 16859
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2005-03-09 17:05:13
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/init: brace4.C
Log message:
2005-03-09 Paolo Carlini <pcarlini@suse.de>
PR c++/16859
* g++.dg/init/brace4.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5131&r2=1.5132
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/brace4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16859] Empty initializer for array of unknown size spuriously accepted
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
` (4 preceding siblings ...)
2005-03-09 17:05 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-09 17:06 ` pcarlini at suse dot de
5 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2005-03-09 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-03-09 17:06 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16859
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-09 17:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-03 2:32 [Bug c++/16859] New: Empty initializer for array of unknown size spuriously accepted bangerth at dealii dot org
2004-08-03 2:36 ` [Bug c++/16859] " pinskia at gcc dot gnu dot org
2005-03-03 17:07 ` pinskia at gcc dot gnu dot org
2005-03-03 18:47 ` pcarlini at suse dot de
2005-03-09 17:04 ` cvs-commit at gcc dot gnu dot org
2005-03-09 17:05 ` cvs-commit at gcc dot gnu dot org
2005-03-09 17:06 ` pcarlini at suse dot de
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).