public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter
@ 2011-12-20 17:08 jason at gcc dot gnu.org
  2012-01-25 17:35 ` [Bug c++/51641] " dodji at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-12-20 17:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

             Bug #: 51641
           Summary: Lookup finds enclosing class member instead of
                    template parameter
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jason@gcc.gnu.org
                CC: dodji@gcc.gnu.org
        Depends on: 36019, 45625


Another case of the lookup problem you fixed previously has come up on the core
mailing list:

struct A {
    struct B { typedef int X; };
};

template<class B> struct C : A {
    B::X q; // Ok: A::B.                                                        
    struct U { typedef int X; };
    template<class U>
        struct D;
};

template<class B>
template<class U>
struct C<B>::D {
    typename U::X r; // { dg-error "" }

C<int>::D<double> y;

The use of U in D should find the template parameter, leading to an error on
instantiation.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
@ 2012-01-25 17:35 ` dodji at gcc dot gnu.org
  2012-01-26 13:30 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-01-25 17:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-01-25
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
  2012-01-25 17:35 ` [Bug c++/51641] " dodji at gcc dot gnu.org
@ 2012-01-26 13:30 ` dodji at gcc dot gnu.org
  2012-01-30 14:37 ` dodji at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-01-26 13:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

--- Comment #1 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-01-26 12:36:25 UTC ---
I candidate patch was sent to
http://gcc.gnu.org/ml/gcc-patches/2012-01/msg01371.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
  2012-01-25 17:35 ` [Bug c++/51641] " dodji at gcc dot gnu.org
  2012-01-26 13:30 ` dodji at gcc dot gnu.org
@ 2012-01-30 14:37 ` dodji at gcc dot gnu.org
  2012-01-30 15:53 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-01-30 14:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

--- Comment #2 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-01-30 14:26:19 UTC ---
Author: dodji
Date: Mon Jan 30 14:26:12 2012
New Revision: 183726

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183726
Log:
PR c++/51641 - Lookup finds enclosing class member instead of template
parameter

gcc/cp/

    PR c++/51641
    * cp-tree.h (template_type_parameter_p): Declare new function.
    (parameter_of_template_p): Remove
    * pt.c (template_type_parameter_p): Define new function.
    (parameter_of_template_p): Remove.
    * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
    on parameter_of_template_p anymore.  Compare the level of the
    template parameter to the depth of the template.

gcc/testsuite/

    PR c++/51641
    * g++.dg/lookup/hidden-class17.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class17.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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-01-30 14:37 ` dodji at gcc dot gnu.org
@ 2012-01-30 15:53 ` dodji at gcc dot gnu.org
  2012-03-13 21:38 ` dodji at gcc dot gnu.org
  2012-03-13 21:50 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-01-30 15:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

--- Comment #3 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-01-30 14:55:50 UTC ---
I have inadvertently committed this in trunk (4.7) even though it wasn't a
regression.  I have now reverted it, and queuing it for 4.8 when stage 1 opens
again.  Sorry.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-01-30 15:53 ` dodji at gcc dot gnu.org
@ 2012-03-13 21:38 ` dodji at gcc dot gnu.org
  2012-03-13 21:50 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-03-13 21:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-03-13 21:25:26 UTC ---
Author: dodji
Date: Tue Mar 13 21:25:22 2012
New Revision: 185357

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185357
Log:
PR c++/51641 - Lookup finds enclosing class member instead of template
parameter

gcc/cp/

    PR c++/51641
    * cp-tree.h (template_type_parameter_p): Declare new function.
    (parameter_of_template_p): Remove
    * pt.c (template_type_parameter_p): Define new function.
    (parameter_of_template_p): Remove.
    * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
    on parameter_of_template_p anymore.  Compare the level of the
    template parameter to the depth of the template.

gcc/testsuite/

    PR c++/51641
    * g++.dg/lookup/hidden-class17.C: New test.


Conflicts:

    gcc/cp/pt.c

Added:
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class17.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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/51641] Lookup finds enclosing class member instead of template parameter
  2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-03-13 21:38 ` dodji at gcc dot gnu.org
@ 2012-03-13 21:50 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-03-13 21:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-03-13 21:37:48 UTC ---
Fixed in trunk (4.8)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-13 21:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 17:08 [Bug c++/51641] New: Lookup finds enclosing class member instead of template parameter jason at gcc dot gnu.org
2012-01-25 17:35 ` [Bug c++/51641] " dodji at gcc dot gnu.org
2012-01-26 13:30 ` dodji at gcc dot gnu.org
2012-01-30 14:37 ` dodji at gcc dot gnu.org
2012-01-30 15:53 ` dodji at gcc dot gnu.org
2012-03-13 21:38 ` dodji at gcc dot gnu.org
2012-03-13 21:50 ` dodji at gcc dot gnu.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).