public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27787]  New: Qualified lookup fails to find inherited class template
@ 2006-05-28 18:21 tschwinger at neoscientists dot org
  2006-05-28 18:43 ` [Bug c++/27787] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tschwinger at neoscientists dot org @ 2006-05-28 18:21 UTC (permalink / raw)
  To: gcc-bugs

// The code has been tested with GCC 3.4.2, 4.1.1 and 4.2.0 (alpha) and fails.
// It compiles successfully with Comeau (>= 4.2) and VisualC++ (>=7.1).

template<typename X>
struct x
{
  template<typename Y>
  struct y
  {
    typedef Y type;
  };
};

template<typename A>
struct a : x<A>
{
  // supposed to fail (unqualified lookup does not look into dependent base)
  // [ 14.6.2-3 ]
  //
  //    template<typename B>
  //    typename y<B>::type f(B);
  //
  // qualified lookup should find inherited class template 'y', however 
  template<typename B>
  typename a::template y<B>::type f(B);
};


-- 
           Summary: Qualified lookup fails to find inherited class template
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tschwinger at neoscientists dot org


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
@ 2006-05-28 18:43 ` pinskia at gcc dot gnu dot org
  2006-05-28 18:43 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-28 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-05-28 18:42 -------
There is a defect report about this if a is really a dependent name or not (or
maybe it is the one about inherite and template and name lookup I forget).


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
  2006-05-28 18:43 ` [Bug c++/27787] " pinskia at gcc dot gnu dot org
@ 2006-05-28 18:43 ` pinskia at gcc dot gnu dot org
  2006-05-28 18:51 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-28 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-05-28 18:43 -------
Replacing a with x<A>, makes this work.


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
  2006-05-28 18:43 ` [Bug c++/27787] " pinskia at gcc dot gnu dot org
  2006-05-28 18:43 ` pinskia at gcc dot gnu dot org
@ 2006-05-28 18:51 ` pinskia at gcc dot gnu dot org
  2006-05-28 21:48 ` tschwinger at neoscientists dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-28 18:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-05-28 18:51 -------
http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#213
And
http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#108

Both seems a way to better understand this but I am confused with what the
standard says with these two defect reports.


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (2 preceding siblings ...)
  2006-05-28 18:51 ` pinskia at gcc dot gnu dot org
@ 2006-05-28 21:48 ` tschwinger at neoscientists dot org
  2006-08-06 22:16 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tschwinger at neoscientists dot org @ 2006-05-28 21:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tschwinger at neoscientists dot org  2006-05-28 21:47 -------

It seems my report is missing some detail.

Here's my apology and an attempt to outline my standard interpretation that
makes me think it is a bug.

(In reply to comment #0)
> 
> template<typename X>
> struct x
> {
>   template<typename Y>
>   struct y
>   {
>     typedef Y type;
>   };
> };
> 
> template<typename A>
> struct a : x<A>
> {
>   //    template<typename B>
>   //    typename y<B>::type f(B); // ill-formed

- the base class 'x<A>' is obviously dependent (since it depends on 'A'), so
GCC validly detects an ill-formed program trying to find 'y' (and so does
Comeau)


>   // qualified lookup should find inherited class template 'y', however 
>   template<typename B>
>   typename a::template y<B>::type f(B);


- the injected class name 'a' refers to the class template specialization (same
as 'a<A>' in this context) and should be found even by unqualified lookup
(works correctly, so far)

- qualified lookup applies to 'template y' because it's qualified by 'a',
14.6.2-3 only applies to unqualified lookup so there is no reason for 'template
y' not to be found


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (3 preceding siblings ...)
  2006-05-28 21:48 ` tschwinger at neoscientists dot org
@ 2006-08-06 22:16 ` bangerth at dealii dot org
  2006-08-25  9:53 ` nathan at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2006-08-06 22:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bangerth at dealii dot org  2006-08-06 22:16 -------
Confirmed. I'm sure this is a duplicate of some other PR, but I don't
know which one right now...

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |3.4.3 4.1.0
      Known to work|                            |2.95.3 3.2.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-06 22:16:30
               date|                            |
   Target Milestone|---                         |4.2.0


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (4 preceding siblings ...)
  2006-08-06 22:16 ` bangerth at dealii dot org
@ 2006-08-25  9:53 ` nathan at gcc dot gnu dot org
  2006-08-25 16:52 ` nathan at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-08-25  9:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-08-06 22:16:30         |2006-08-25 09:53:17
               date|                            |


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (5 preceding siblings ...)
  2006-08-25  9:53 ` nathan at gcc dot gnu dot org
@ 2006-08-25 16:52 ` nathan at gcc dot gnu dot org
  2006-08-25 16:56 ` nathan at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-08-25 16:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from nathan at gcc dot gnu dot org  2006-08-25 16:52 -------
2006-08-25  Nathan Sidwell  <nathan@codesourcery.com>

        PR c++/27787
        * decl.c (make_typename_type): Only try and resolve it when
        context is not dependent.  Refactor.
        * decl2.c (check_classfn): Push to class scope before looking for
        the function.


-- 

nathan at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (6 preceding siblings ...)
  2006-08-25 16:52 ` nathan at gcc dot gnu dot org
@ 2006-08-25 16:56 ` nathan at gcc dot gnu dot org
  2006-10-18  9:18 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-08-25 16:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from nathan at gcc dot gnu dot org  2006-08-25 16:56 -------
Subject: Bug 27787

Author: nathan
Date: Fri Aug 25 16:56:07 2006
New Revision: 116409

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116409
Log:
cp/
        PR c++/27787
        * decl.c (make_typename_type): Only try and resolve it when
        context is not dependent.  Refactor.
        * decl2.c (check_classfn): Push to class scope before looking for
        the function.
testsuite/
        PR c++/27787
        * g++.dg/template/typename10.C: New.
        * g++.dg/template/lookup4.C: Remove bogus error marker.

Added:
    trunk/gcc/testsuite/g++.dg/template/typename10.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/template/lookup4.C


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (7 preceding siblings ...)
  2006-08-25 16:56 ` nathan at gcc dot gnu dot org
@ 2006-10-18  9:18 ` rguenth at gcc dot gnu dot org
  2006-10-27  1:26 ` pinskia at gcc dot gnu dot org
  2007-04-23 21:29 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-10-18  9:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-10-18 09:18 -------
Subject: Bug 27787

Author: rguenth
Date: Wed Oct 18 09:18:07 2006
New Revision: 117852

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117852
Log:
2006-10-18  Richard Guenther  <rguenther@suse.de>

        PR C++/25878
        Backport from mainline:
        2006-08-25  Nathan Sidwell  <nathan@codesourcery.com>

        PR c++/27787
        * decl.c (make_typename_type): Only try and resolve it when
        context is not dependent.  Refactor.
        * decl2.c (check_classfn): Push to class scope before looking
        * for
        the function.

        * g++.dg/template/typename10.C: New.
        * g++.dg/template/lookup4.C: Remove bogus error marker.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/typename10.C
      - copied unchanged from r116409,
trunk/gcc/testsuite/g++.dg/template/typename10.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/decl2.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/lookup4.C


-- 


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (8 preceding siblings ...)
  2006-10-18  9:18 ` rguenth at gcc dot gnu dot org
@ 2006-10-27  1:26 ` pinskia at gcc dot gnu dot org
  2007-04-23 21:29 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-27  1:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-10-27 01:26 -------
Actually I think this is the same as DR 224 which says "a" here is not
dependent but shown by PR 29469 comment #5, that DR report is bogus. 


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |9634


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


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

* [Bug c++/27787] Qualified lookup fails to find inherited class template
  2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
                   ` (9 preceding siblings ...)
  2006-10-27  1:26 ` pinskia at gcc dot gnu dot org
@ 2007-04-23 21:29 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-23 21:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|2.95.3 3.2.3                |2.95.3 3.2.3 4.1.2
   Target Milestone|4.2.0                       |4.1.2


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


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

end of thread, other threads:[~2007-04-23 21:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-28 18:21 [Bug c++/27787] New: Qualified lookup fails to find inherited class template tschwinger at neoscientists dot org
2006-05-28 18:43 ` [Bug c++/27787] " pinskia at gcc dot gnu dot org
2006-05-28 18:43 ` pinskia at gcc dot gnu dot org
2006-05-28 18:51 ` pinskia at gcc dot gnu dot org
2006-05-28 21:48 ` tschwinger at neoscientists dot org
2006-08-06 22:16 ` bangerth at dealii dot org
2006-08-25  9:53 ` nathan at gcc dot gnu dot org
2006-08-25 16:52 ` nathan at gcc dot gnu dot org
2006-08-25 16:56 ` nathan at gcc dot gnu dot org
2006-10-18  9:18 ` rguenth at gcc dot gnu dot org
2006-10-27  1:26 ` pinskia at gcc dot gnu dot org
2007-04-23 21:29 ` pinskia 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).