[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From nathan at codesourcery dot com 2004-12-08 09:05 --- Subject: Re: [3.4/4.0 regression] template member with same name as class not rejected Mark Mitchell wrote: lerdsuwa at gcc dot gnu dot org wrote: --- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-07 12:34 --- Patch for 3.4 is submitted: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00450.html (There is a typo in your test case; you meant nested instead of ested.) That aside, I'm concerned that this fix might cause something else to break, and, given that the problem is only a missed diagnostic, I do not think that's a good tradeoff. Nathan, what do you think? Does this allow templated ctors? If those are still permitted, I think the patch is ok. (IMO it would be simpler to check those things that are allowed to have the same name, rather than all those that aren't. That would not be a sensible 3.4 change though.) nathan -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-08 10:12 --- push_class_level_binding is never called for ctors and dtors because of a login in add_method. So my patch doesn't affect template ctor. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-12-08 10:25 --- Subject: Bug 18100 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2004-12-08 10:25:23 Modified files: gcc/cp : ChangeLog decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: name-clash4.C Log message: PR c++/18100 * decl.c (lookup_and_check_tag): Diagnose nested class with the same name as enclosing class. * g++.dg/lookup/name-clash4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gccr1=1.4520r2=1.4521 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gccr1=1.1339r2=1.1340 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gccr1=1.4723r2=1.4724 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/name-clash4.C.diff?cvsroot=gccr1=NONEr2=1.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-12-08 10:54 --- Subject: Bug 18100 CVSROOT:/cvs/gcc Module name:gcc Branch: gcc-3_4-branch Changes by: [EMAIL PROTECTED] 2004-12-08 10:53:30 Modified files: gcc/cp : ChangeLog name-lookup.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: name-clash4.C Log message: PR c++/18100 * name-lookup.c (push_class_level_binding): Diagnose nested class template with the same name as enclosing class. * g++.dg/lookup/name-clash4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcconly_with_tag=gcc-3_4-branchr1=1.3892.2.182r2=1.3892.2.183 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcconly_with_tag=gcc-3_4-branchr1=1.34.2.19r2=1.34.2.20 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcconly_with_tag=gcc-3_4-branchr1=1.3389.2.319r2=1.3389.2.320 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/name-clash4.C.diff?cvsroot=gcconly_with_tag=gcc-3_4-branchr1=NONEr2=1.1.2.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-08 10:56 --- Fixed. -- What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-07 12:34 --- Patch for 3.4 is submitted: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00450.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From mark at codesourcery dot com 2004-12-08 05:48 --- Subject: Re: [3.4/4.0 regression] template member with same name as class not rejected lerdsuwa at gcc dot gnu dot org wrote: --- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-07 12:34 --- Patch for 3.4 is submitted: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00450.html (There is a typo in your test case; you meant nested instead of ested.) That aside, I'm concerned that this fix might cause something else to break, and, given that the problem is only a missed diagnostic, I do not think that's a good tradeoff. Nathan, what do you think? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-06 10:25 --- Patch for 4.0 submitted: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00388.html Patch for 3.4 in progress. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-12-04 07:34 --- Got it. -- What|Removed |Added AssignedTo|unassigned at gcc dot gnu |lerdsuwa at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-16 10:05 --- On mainline we now have an ICE: PR18100.cc:3: error: 'A' is not a template type PR18100.cc:3: internal compiler error: in xref_basetypes, at cp/decl.c:9364 Please submit a full bug report, [etc.] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-16 20:35 --- At least we have an error message now. But the error message isn't quite correct. The 3.3 branch gives a better one: PR18100.cc:2: error: duplicate nested type `struct A' Kriang, the ICE was introduced with your name-lookup patch http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg00680.html Maybe you want to have a look at this one. -- What|Removed |Added CC||lerdsuwa at gcc dot gnu dot ||org Keywords||error-recovery, ice-on- ||invalid-code Known to fail||3.4.0 3.4.3 4.0.0 Known to work||3.3.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-16 21:08 --- Another hint: The accepts-invalid bug was introduced by Mark's patch for PR14086: http://gcc.gnu.org/ml/gcc-cvs/2004-02/msg00790.html -- What|Removed |Added CC||mmitchel at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From mmitchel at gcc dot gnu dot org 2004-11-01 00:46 --- 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=18100
[Bug c++/18100] [3.4/4.0 regression] template member with same name as class not rejected
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-21 21:02 --- : 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). A very recent (meaning close to right after 3.4 branch) regression. -- What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed||1 Last reconfirmed|-00-00 00:00:00 |2004-10-21 21:02:07 date|| Target Milestone|--- |3.4.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18100