public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size
@ 2005-02-16 5:11 reichelt at gcc dot gnu dot org
2005-02-16 5:15 ` [Bug c++/19991] " reichelt at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-02-16 5:11 UTC (permalink / raw)
To: gcc-bugs
The following valid code snippet is rejected since gcc 3.4.0:
=================================
enum { e = 1 };
template<typename> struct A
{
static const int i = e;
char a[i];
};
=================================
The error message is:
bug.cc:6: error: size of array `a' is not an integral constant-expression
However, the ocde is accepted if I declare "e" as "const int" instead of an
enum value, or if I use "a[e]" instead of "a[i]", or if I make "A" a
non-template struct.
This is related tp PR19983.
--
Summary: [3.4/4.0 regression] Enum not accepted in array-size
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: rejects-valid, monitored
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4/4.0 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
@ 2005-02-16 5:15 ` reichelt at gcc dot gnu dot org
2005-02-16 6:19 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-02-16 5:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-02-15 23:16 -------
Sorry, this is related to PR19883, of course.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4/4.0 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
2005-02-16 5:15 ` [Bug c++/19991] " reichelt at gcc dot gnu dot org
@ 2005-02-16 6:19 ` pinskia at gcc dot gnu dot org
2005-02-16 18:59 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-16 6:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-15 23:20 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-02-15 23:20:23
date| |
Target Milestone|--- |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4/4.0 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
2005-02-16 5:15 ` [Bug c++/19991] " reichelt at gcc dot gnu dot org
2005-02-16 6:19 ` pinskia at gcc dot gnu dot org
@ 2005-02-16 18:59 ` pinskia at gcc dot gnu dot org
2005-02-23 6:52 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-16 18:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-16 14:43 -------
: Search converges between 2004-02-01-trunk (#445) and 2004-03-01-trunk (#446).
: Search converges between 2004-02-02-3.4 (#1) and 2004-03-01-3.4 (#2).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4/4.0 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-02-16 18:59 ` pinskia at gcc dot gnu dot org
@ 2005-02-23 6:52 ` mmitchel at gcc dot gnu dot org
2005-02-23 13:05 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-02-23 6:52 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4/4.0 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-02-23 6:52 ` mmitchel at gcc dot gnu dot org
@ 2005-02-23 13:05 ` cvs-commit at gcc dot gnu dot org
2005-02-23 14:02 ` [Bug c++/19991] [3.4 " mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-23 13:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-02-23 05:31 -------
Subject: Bug 19991
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2005-02-23 05:30:51
Modified files:
gcc/testsuite/g++.dg/template: qualttp15.C
gcc/testsuite/g++.old-deja/g++.other: struct1.C
gcc/testsuite : ChangeLog
gcc/cp : ChangeLog decl2.c error.c init.c parser.c
semantics.c
Added files:
gcc/testsuite/g++.dg/parse: constant7.C error27.C error26.C
gcc/testsuite/g++.dg/template: error17.C
Log message:
PR c++/19991
* init.c (integral_constant_value): Iterate if the value of a decl
is itself a constant.
PR c++/20152
* parser.c (cp_parser_class_head): Check for redefintions here.
* semantics.c (begin_class_definition): Not here.
PR c++/20153
* decl2.c (build_anon_union_vars): Add type parameter.
(finish_anon_union): Pass it.
PR c++/20148
* error.c (dump_expr): Do not print the body of a BIND_EXPR.
Handle STATEMENT_LIST.
PR c++/19991
* g++.dg/parse/constant7.C: New test.
PR c++/20152
* g++.dg/parse/error27.C: New test.
* g++.dg/template/qualttp15.C: Adjust error markers.
* g++.old-deja/g++.other/struct1.C: Likewise.
PR c++/20153
* g++.dg/template/error17.C: New test.
PR c++/20148
* g++.dg/parser/error26.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/constant7.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error27.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error26.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/error17.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/qualttp15.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/struct1.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5072&r2=1.5073
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4641&r2=1.4642
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.768&r2=1.769
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.276&r2=1.277
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.410&r2=1.411
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.317&r2=1.318
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.462&r2=1.463
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-02-23 13:05 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-23 14:02 ` mmitchel at gcc dot gnu dot org
2005-05-02 14:47 ` cvs-commit at gcc dot gnu dot org
2005-05-02 14:48 ` mmitchel at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-02-23 14:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-02-23 05:36 -------
Fixed in 4.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.4/4.0 regression] Enum |[3.4 regression] Enum not
|not accepted in array-size |accepted in array-size
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-02-23 14:02 ` [Bug c++/19991] [3.4 " mmitchel at gcc dot gnu dot org
@ 2005-05-02 14:47 ` cvs-commit at gcc dot gnu dot org
2005-05-02 14:48 ` mmitchel at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-02 14:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-02 14:47 -------
Subject: Bug 19991
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: mmitchel@gcc.gnu.org 2005-05-02 14:46:48
Modified files:
gcc/cp : ChangeLog init.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/parse: constant7.C
Log message:
Backport:
2005-02-22 Mark Mitchell <mark@codesourcery.com>
PR c++/19991
* g++.dg/parse/constant7.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.214&r2=1.3892.2.215
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.356.2.17&r2=1.356.2.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.387&r2=1.3389.2.388
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/constant7.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.28.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/19991] [3.4 regression] Enum not accepted in array-size
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-05-02 14:47 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-02 14:48 ` mmitchel at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-02 14:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-05-02 14:48 -------
Fixed in 3.4.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19991
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-05-02 14:48 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-16 5:11 [Bug c++/19991] New: [3.4/4.0 regression] Enum not accepted in array-size reichelt at gcc dot gnu dot org
2005-02-16 5:15 ` [Bug c++/19991] " reichelt at gcc dot gnu dot org
2005-02-16 6:19 ` pinskia at gcc dot gnu dot org
2005-02-16 18:59 ` pinskia at gcc dot gnu dot org
2005-02-23 6:52 ` mmitchel at gcc dot gnu dot org
2005-02-23 13:05 ` cvs-commit at gcc dot gnu dot org
2005-02-23 14:02 ` [Bug c++/19991] [3.4 " mmitchel at gcc dot gnu dot org
2005-05-02 14:47 ` cvs-commit at gcc dot gnu dot org
2005-05-02 14:48 ` mmitchel at gcc dot gnu dot org
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).