* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
@ 2008-12-28 6:29 ` pinskia at gcc dot gnu dot org
2008-12-29 21:35 ` rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-28 6:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-28 06:27 -------
Confirmed.
Here is a rejects valid:
#include <iostream>
struct B {
static const int x = 1;
};
struct A {
template <typename A>
static void f() {
std::cerr << A::x << std::endl;
}
};
int main() {
A::f<B>();
return 0;
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|i486-linux-gnu |
GCC host triplet|i486-linux-gnu |
GCC target triplet|i486-linux-gnu |
Keywords| |rejects-valid
Known to fail| |4.3.0 4.0.1 4.4.0 4.3.2
| |4.3.3
Known to work| |3.3.3
Last reconfirmed|0000-00-00 00:00:00 |2008-12-28 06:27:52
date| |
Summary|template parameter does not |[4.2/4.3/4.4 Regression]
|hide class name |template parameter does not
| |hide class name
Target Milestone|--- |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
2008-12-28 6:29 ` [Bug c++/36019] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2008-12-29 21:35 ` rguenth at gcc dot gnu dot org
2009-01-07 1:11 ` dodji at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 21:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-12-29 20:57 -------
P1 for 4.4, not really for the branches.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
2008-12-28 6:29 ` [Bug c++/36019] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2008-12-29 21:35 ` rguenth at gcc dot gnu dot org
@ 2009-01-07 1:11 ` dodji at gcc dot gnu dot org
2009-01-08 23:03 ` dodji at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-07 1:11 UTC (permalink / raw)
To: gcc-bugs
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dodji at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2008-12-28 06:27:52 |2009-01-07 01:11:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (2 preceding siblings ...)
2009-01-07 1:11 ` dodji at gcc dot gnu dot org
@ 2009-01-08 23:03 ` dodji at gcc dot gnu dot org
2009-01-09 19:11 ` dodji at gcc dot gnu dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-08 23:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dodji at gcc dot gnu dot org 2009-01-08 23:03 -------
Created an attachment (id=17059)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17059&action=view)
candidate patch
I think what is happening is that lookup_name_real (in name-lookup.c) makes
sure types defined in the class hierarchy hide template type parameters. That
scheme is implemented in the outer_binding accessor function.
That scheme is fine for class templates, as stated in the spec in [temp.res]
and [temp.local].
Template parameters of member templates though, should hide types defined in
the class scope.
This patch tries to implement that. But I am not sure if it's the right
approach. I'll keep working on it until it's suitable for submission to
gcc-patches.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (3 preceding siblings ...)
2009-01-08 23:03 ` dodji at gcc dot gnu dot org
@ 2009-01-09 19:11 ` dodji at gcc dot gnu dot org
2009-01-12 22:41 ` dodji at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-09 19:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dodji at gcc dot gnu dot org 2009-01-09 19:10 -------
Created an attachment (id=17066)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17066&action=view)
A better patch
I believe this patch should be better that the previous one because it seems to
be more generic. I am still testing it and thinking about it.
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #17059|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (4 preceding siblings ...)
2009-01-09 19:11 ` dodji at gcc dot gnu dot org
@ 2009-01-12 22:41 ` dodji at gcc dot gnu dot org
2009-01-12 22:44 ` dodji at gcc dot gnu dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-12 22:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dodji at gcc dot gnu dot org 2009-01-12 22:41 -------
Subject: Bug 36019
Author: dodji
Date: Mon Jan 12 22:41:19 2009
New Revision: 143313
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143313
Log:
gcc/cp/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* pt.c (parameter_of_template_p): New function.
* pt.c (get_template_info): Ditto.
* cp-tree.h: Declare those.
* name-lookup.c (binding_to_template_parms_of_scope_p): New
function.
(outer_binding): Take template parameters in account when looking for
a name binding.
gcc/testsuite/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* g++.dg/lookup/hidden-class12.C: New test.
* g++.dg/lookup/hidden-class13.C: New test.
* g++.dg/lookup/hidden-class14.C: New test.
* g++.dg/lookup/hidden-class15.C: New test.
* g++.dg/lookup/hidden-class16.C: New test.
* gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C: Adjust testcase.
Added:
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/lookup/hidden-class12.C
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/lookup/hidden-class13.C
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/lookup/hidden-class14.C
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/lookup/hidden-class15.C
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/lookup/hidden-class16.C
Modified:
branches/gcc-4_2-branch/gcc/cp/ChangeLog
branches/gcc-4_2-branch/gcc/cp/cp-tree.h
branches/gcc-4_2-branch/gcc/cp/name-lookup.c
branches/gcc-4_2-branch/gcc/cp/pt.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
branches/gcc-4_2-branch/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (5 preceding siblings ...)
2009-01-12 22:41 ` dodji at gcc dot gnu dot org
@ 2009-01-12 22:44 ` dodji at gcc dot gnu dot org
2009-01-12 22:48 ` dodji at gcc dot gnu dot org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-12 22:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from dodji at gcc dot gnu dot org 2009-01-12 22:44 -------
Subject: Bug 36019
Author: dodji
Date: Mon Jan 12 22:44:13 2009
New Revision: 143314
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143314
Log:
gcc/cp/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* pt.c (parameter_of_template_p): New function.
* cp-tree.h: Declare it.
* name-lookup.c (binding_to_template_parms_of_scope_p): New
function.
(outer_binding): Take template parameters in account when looking for
a name binding.
gcc/testsuite/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* g++.dg/lookup/hidden-class12.C: New test.
* g++.dg/lookup/hidden-class13.C: New test.
* g++.dg/lookup/hidden-class14.C: New test.
* g++.dg/lookup/hidden-class15.C: New test.
* g++.dg/lookup/hidden-class16.C: New test.
* gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C: Adjust testcase.
Added:
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/lookup/hidden-class12.C
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/lookup/hidden-class13.C
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/lookup/hidden-class14.C
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/lookup/hidden-class15.C
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/lookup/hidden-class16.C
Modified:
branches/gcc-4_3-branch/gcc/cp/ChangeLog
branches/gcc-4_3-branch/gcc/cp/cp-tree.h
branches/gcc-4_3-branch/gcc/cp/name-lookup.c
branches/gcc-4_3-branch/gcc/cp/pt.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
branches/gcc-4_3-branch/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (6 preceding siblings ...)
2009-01-12 22:44 ` dodji at gcc dot gnu dot org
@ 2009-01-12 22:48 ` dodji at gcc dot gnu dot org
2009-01-12 22:50 ` dodji at gcc dot gnu dot org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-12 22:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dodji at gcc dot gnu dot org 2009-01-12 22:48 -------
Subject: Bug 36019
Author: dodji
Date: Mon Jan 12 22:47:49 2009
New Revision: 143315
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143315
Log:
gcc/cp/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* pt.c (parameter_of_template_p): New function.
* cp-tree.h: Declare it.
* name-lookup.c (binding_to_template_parms_of_scope_p): New
function.
(outer_binding): Take template parameters in account when looking for
a name binding.
gcc/testsuite/ChangeLog:
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
* g++.dg/lookup/hidden-class12.C: New test.
* g++.dg/lookup/hidden-class13.C: New test.
* g++.dg/lookup/hidden-class14.C: New test.
* g++.dg/lookup/hidden-class15.C: New test.
* g++.dg/lookup/hidden-class16.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/lookup/hidden-class12.C
trunk/gcc/testsuite/g++.dg/lookup/hidden-class13.C
trunk/gcc/testsuite/g++.dg/lookup/hidden-class14.C
trunk/gcc/testsuite/g++.dg/lookup/hidden-class15.C
trunk/gcc/testsuite/g++.dg/lookup/hidden-class16.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (7 preceding siblings ...)
2009-01-12 22:48 ` dodji at gcc dot gnu dot org
@ 2009-01-12 22:50 ` dodji at gcc dot gnu dot org
2009-01-12 23:01 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-12 22:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dodji at gcc dot gnu dot org 2009-01-12 22:50 -------
Fixed in trunk, gcc-4_3 and gcc-4_2.
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (8 preceding siblings ...)
2009-01-12 22:50 ` dodji at gcc dot gnu dot org
@ 2009-01-12 23:01 ` jakub at gcc dot gnu dot org
2009-01-13 16:50 ` dodji at redhat dot com
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-12 23:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2009-01-12 23:00 -------
The 4.3 version seems to be the old one, with is_* prefixes and macro, while
trunk/4.2 are the new ones.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (9 preceding siblings ...)
2009-01-12 23:01 ` jakub at gcc dot gnu dot org
@ 2009-01-13 16:50 ` dodji at redhat dot com
2009-03-03 22:01 ` jason at gcc dot gnu dot org
2009-03-03 22:01 ` jason at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: dodji at redhat dot com @ 2009-01-13 16:50 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
------- Comment #10 from dodji at gcc dot gnu dot org 2009-01-13 16:50 -------
Subject: Re: [4.2/4.3/4.4 Regression] template parameter does
not hide class name
jakub at gcc dot gnu dot org a écrit :
> ------- Comment #9 from jakub at gcc dot gnu dot org 2009-01-12 23:00 -------
> The 4.3 version seems to be the old one, with is_* prefixes and macro, while
> trunk/4.2 are the new ones.
Oops, right. Fixing that now. Thanks.
Dodji.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (10 preceding siblings ...)
2009-01-13 16:50 ` dodji at redhat dot com
@ 2009-03-03 22:01 ` jason at gcc dot gnu dot org
2009-03-03 22:01 ` jason at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-03-03 22:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from jason at gcc dot gnu dot org 2009-03-03 22:01 -------
*** Bug 13967 has been marked as a duplicate of this bug. ***
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gianni at mariani dot ws
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/36019] [4.2/4.3/4.4 Regression] template parameter does not hide class name
2008-04-22 21:30 [Bug c++/36019] New: template parameter does not hide class name deba at inf dot elte dot hu
` (11 preceding siblings ...)
2009-03-03 22:01 ` jason at gcc dot gnu dot org
@ 2009-03-03 22:01 ` jason at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-03-03 22:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from jason at gcc dot gnu dot org 2009-03-03 22:00 -------
Incidentally, this is core issue 458.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36019
^ permalink raw reply [flat|nested] 14+ messages in thread