public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17473] New: typedef redefinition in struct is accepted
@ 2004-09-14 2:11 llib at computer dot org
2004-09-14 7:54 ` [Bug c++/17473] " wsf at fultondesigns dot co dot uk
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: llib at computer dot org @ 2004-09-14 2:11 UTC (permalink / raw)
To: gcc-bugs
(accepts-illegal)
the following code
"""
struct S {
typedef int Int;
typedef int Int;
};
"""
is accepted by g++. This is illegal according to 9.2/1
"""
A member shall not be be declared twice in the /member-
specification/, except that a nested class or member class
template can be declared and then later defined.
"""
Note that this conflicts with 7.1.3/2, but 9.2/1 is more specific (class-only
specification scopes).
--
Summary: typedef redefinition in struct is accepted
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: llib at computer dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.9
GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
@ 2004-09-14 7:54 ` wsf at fultondesigns dot co dot uk
2004-09-17 2:15 ` giovannibajo at libero dot it
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: wsf at fultondesigns dot co dot uk @ 2004-09-14 7:54 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |wsf at fultondesigns dot co
| |dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
2004-09-14 7:54 ` [Bug c++/17473] " wsf at fultondesigns dot co dot uk
@ 2004-09-17 2:15 ` giovannibajo at libero dot it
2004-11-01 0:45 ` [Bug c++/17473] [3.3/3.4/4.0 Regression] " mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-17 2:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-09-17 02:15 -------
Confirmed, a regression from 2.95.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Known to fail| |3.0.4 3.2.2 3.3.1 3.3.4
| |3.4.0 4.0.0
Known to work| |2.95
Last reconfirmed|0000-00-00 00:00:00 |2004-09-17 02:15:01
date| |
Target Milestone|--- |3.4.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] [3.3/3.4/4.0 Regression] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
2004-09-14 7:54 ` [Bug c++/17473] " wsf at fultondesigns dot co dot uk
2004-09-17 2:15 ` giovannibajo at libero dot it
@ 2004-11-01 0:45 ` mmitchel at gcc dot gnu dot org
2004-11-24 21:02 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-01 0:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-11-01 00:45 -------
Postponed until GCC 3.4.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.3 |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] [3.3/3.4/4.0 Regression] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
` (2 preceding siblings ...)
2004-11-01 0:45 ` [Bug c++/17473] [3.3/3.4/4.0 Regression] " mmitchel at gcc dot gnu dot org
@ 2004-11-24 21:02 ` mmitchel at gcc dot gnu dot org
2004-11-24 23:19 ` cvs-commit at gcc dot gnu dot org
2004-11-24 23:24 ` [Bug c++/17473] [3.3/3.4 " mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-24 21:02 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=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] [3.3/3.4/4.0 Regression] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
` (3 preceding siblings ...)
2004-11-24 21:02 ` mmitchel at gcc dot gnu dot org
@ 2004-11-24 23:19 ` cvs-commit at gcc dot gnu dot org
2004-11-24 23:24 ` [Bug c++/17473] [3.3/3.4 " mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-24 23:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-11-24 23:19 -------
Subject: Bug 17473
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-11-24 23:18:56
Modified files:
gcc/cp : ChangeLog name-lookup.c parser.c
gcc/testsuite : ChangeLog
gcc/testsuite/g++.dg/template: typedef1.C
gcc/testsuite/g++.old-deja/g++.other: typedef7.C
Added files:
gcc/testsuite/g++.dg/parse: typedef7.C
Removed files:
gcc/testsuite/g++.dg/tc1: dr56.C
Log message:
PR c++/17473
* name-lookup.c (supplement_binding): Do not allow typedefs to be
redefined in class scope.
PR c++/18285
* parser.c (cp_parser_set_decl_type_spec): Do not try to allow
redefinitions of builtin types other that "bool" or "wchar_t".
PR c++/17473
* g++.dg/tc1/dr56.C: Remove.
* g++.dg/template/typedef1.C: Add dg-error markers.
* g++.old-deja/g++.other/typedef7.C: Likewise.
PR c++/18285
* g++.dg/parse/typedef7.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4494&r2=1.4495
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.92&r2=1.93
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.280&r2=1.281
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4644&r2=1.4645
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tc1/dr56.C.diff?cvsroot=gcc&r1=1.2&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typedef1.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/typedef7.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typedef7.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17473] [3.3/3.4 Regression] typedef redefinition in struct is accepted
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
` (4 preceding siblings ...)
2004-11-24 23:19 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-24 23:24 ` mmitchel at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-24 23:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-11-24 23:24 -------
Fixed in GCC 4.0.
I do not intend to backport this to 3.4.x, as doing so would potentially break
code that works in 3.4.3, and has no semantic ambiguity.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|3.0.4 3.2.2 3.3.1 3.3.4 |3.0.4 3.2.2 3.3.1 3.3.4
|3.4.0 4.0.0 |3.4.0
Known to work|2.95 |2.95 4.0.0
Resolution| |FIXED
Summary|[3.3/3.4/4.0 Regression] |[3.3/3.4 Regression] typedef
|typedef redefinition in |redefinition in struct is
|struct is accepted |accepted
Target Milestone|3.4.4 |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17473
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-11-24 23:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-14 2:11 [Bug c++/17473] New: typedef redefinition in struct is accepted llib at computer dot org
2004-09-14 7:54 ` [Bug c++/17473] " wsf at fultondesigns dot co dot uk
2004-09-17 2:15 ` giovannibajo at libero dot it
2004-11-01 0:45 ` [Bug c++/17473] [3.3/3.4/4.0 Regression] " mmitchel at gcc dot gnu dot org
2004-11-24 21:02 ` mmitchel at gcc dot gnu dot org
2004-11-24 23:19 ` cvs-commit at gcc dot gnu dot org
2004-11-24 23:24 ` [Bug c++/17473] [3.3/3.4 " 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).