public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration
@ 2006-11-18 12:38 reichelt at gcc dot gnu dot org
2006-11-18 12:52 ` [Bug c++/29886] " reichelt at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-11-18 12:38 UTC (permalink / raw)
To: gcc-bugs
The following IMHO valid code snippet is rejected since GCC 4.0.0:
============================
struct A
{
static int x[1];
};
void foo(int i)
{
if (int(A::x[i])) {}
}
============================
bug.cc: In function 'void foo(int)':
bug.cc:8: error: array bound is not an integer constant
--
Summary: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted
as variable declaration
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
@ 2006-11-18 12:52 ` reichelt at gcc dot gnu dot org
2006-11-18 14:47 ` [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] Cast " rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-11-18 12:52 UTC (permalink / raw)
To: gcc-bugs
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
2006-11-18 12:52 ` [Bug c++/29886] " reichelt at gcc dot gnu dot org
@ 2006-11-18 14:47 ` rguenth at gcc dot gnu dot org
2006-11-27 3:39 ` mmitchel at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-11-18 14:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2006-11-18 14:47 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-11-18 14:47:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
2006-11-18 12:52 ` [Bug c++/29886] " reichelt at gcc dot gnu dot org
2006-11-18 14:47 ` [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] Cast " rguenth at gcc dot gnu dot org
@ 2006-11-27 3:39 ` mmitchel at gcc dot gnu dot org
2006-11-27 3:46 ` [Bug c++/29886] [4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 3:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from mmitchel at gcc dot gnu dot org 2006-11-27 03:39 -------
Subject: Bug 29886
Author: mmitchel
Date: Mon Nov 27 03:38:57 2006
New Revision: 119242
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119242
Log:
PR c++/29886
* parser.c (cp_parser): Add in_function_body.
(cp_parser_new): Initialize it.
(cp_parser_primary_expression): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_asm_definition): Likewise.
(cp_parser_direct_declarator): Likewise.
(cp_parser_class_specifier): Clear parser->in_function_body.
(cp_parser_constructor_declarator_p): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_function_body_after_declarator): Set
parser->in_function_body.
PR c++/29886
* g++.dg/expr/cast8.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/expr/cast8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.1/4.2 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-11-27 3:39 ` mmitchel at gcc dot gnu dot org
@ 2006-11-27 3:46 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:38 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 3:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from mmitchel at gcc dot gnu dot org 2006-11-27 03:46 -------
Fixed in 4.3.0.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0/4.1/4.2/4.3 regression]|[4.0/4.1/4.2 regression]
|Cast misinterpreted as |Cast misinterpreted as
|variable declaration |variable declaration
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.1/4.2 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-11-27 3:46 ` [Bug c++/29886] [4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
@ 2006-11-27 4:38 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:39 ` [Bug c++/29886] [4.0/4.2 " mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 4:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from mmitchel at gcc dot gnu dot org 2006-11-27 04:38 -------
Subject: Bug 29886
Author: mmitchel
Date: Mon Nov 27 04:38:34 2006
New Revision: 119243
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119243
Log:
PR c++/29886
* parser.c (cp_parser): Add in_function_body.
(cp_parser_new): Initialize it.
(cp_parser_primary_expression): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_asm_definition): Likewise.
(cp_parser_direct_declarator): Likewise.
(cp_parser_class_specifier): Clear parser->in_function_body.
(cp_parser_constructor_declarator_p): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_function_body_after_declarator): Set
parser->in_function_body.
PR c++/29886
* g++.dg/expr/cast8.C: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/g++.dg/expr/cast8.C
Modified:
branches/gcc-4_1-branch/gcc/cp/ChangeLog
branches/gcc-4_1-branch/gcc/cp/parser.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.2 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2006-11-27 4:38 ` mmitchel at gcc dot gnu dot org
@ 2006-11-27 4:39 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:56 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 4:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from mmitchel at gcc dot gnu dot org 2006-11-27 04:39 -------
Fixed in 4.1.2.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Summary|[4.0/4.1/4.2 regression] |[4.0/4.2 regression] Cast
|Cast misinterpreted as |misinterpreted as variable
|variable declaration |declaration
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0/4.2 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2006-11-27 4:39 ` [Bug c++/29886] [4.0/4.2 " mmitchel at gcc dot gnu dot org
@ 2006-11-27 4:56 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:56 ` [Bug c++/29886] [4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 20:52 ` reichelt at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 4:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from mmitchel at gcc dot gnu dot org 2006-11-27 04:56 -------
Subject: Bug 29886
Author: mmitchel
Date: Mon Nov 27 04:56:02 2006
New Revision: 119244
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119244
Log:
PR c++/29886
* parser.c (cp_parser): Add in_function_body.
(cp_parser_new): Initialize it.
(cp_parser_primary_expression): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_asm_definition): Likewise.
(cp_parser_direct_declarator): Likewise.
(cp_parser_class_specifier): Clear parser->in_function_body.
(cp_parser_constructor_declarator_p): Use parser->in_function_body
instead of at_function_scope_p.
(cp_parser_function_body_after_declarator): Set
parser->in_function_body.
PR c++/29886
* g++.dg/expr/cast8.C: New test.
Added:
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/expr/cast8.C
Modified:
branches/gcc-4_2-branch/gcc/cp/ChangeLog
branches/gcc-4_2-branch/gcc/cp/parser.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2006-11-27 4:56 ` mmitchel at gcc dot gnu dot org
@ 2006-11-27 4:56 ` mmitchel at gcc dot gnu dot org
2007-02-03 20:52 ` reichelt at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-11-27 4:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from mmitchel at gcc dot gnu dot org 2006-11-27 04:56 -------
Fixed in 4.2.0.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0/4.2 regression] Cast |[4.0 regression] Cast
|misinterpreted as variable |misinterpreted as variable
|declaration |declaration
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/29886] [4.0 regression] Cast misinterpreted as variable declaration
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2006-11-27 4:56 ` [Bug c++/29886] [4.0 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 20:52 ` reichelt at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-03 20:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from reichelt at gcc dot gnu dot org 2007-02-03 20:52 -------
Won't be fixed on the 4.0 branch.
Fixed in GCC 4.1.2.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|4.0.4 |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29886
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-02-03 20:52 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-18 12:38 [Bug c++/29886] New: [4.0/4.1/4.2/4.3 regression] C-style cast misinterpreted as variable declaration reichelt at gcc dot gnu dot org
2006-11-18 12:52 ` [Bug c++/29886] " reichelt at gcc dot gnu dot org
2006-11-18 14:47 ` [Bug c++/29886] [4.0/4.1/4.2/4.3 regression] Cast " rguenth at gcc dot gnu dot org
2006-11-27 3:39 ` mmitchel at gcc dot gnu dot org
2006-11-27 3:46 ` [Bug c++/29886] [4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-11-27 4:38 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:39 ` [Bug c++/29886] [4.0/4.2 " mmitchel at gcc dot gnu dot org
2006-11-27 4:56 ` mmitchel at gcc dot gnu dot org
2006-11-27 4:56 ` [Bug c++/29886] [4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 20:52 ` reichelt 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).