c++/189: Re: g++ 2.95.2 parse error in qualified member name lookup

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Mon May 1 02:56:00 GMT 2000


>Number:         189
>Category:       c++
>Synopsis:       g++ 2.95.2 parse error in qualified member name lookup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          analyzed
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon May 01 02:56:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Martin Sebor <sebor@roguewave.com>
>Release:        2.95.2
>Organization:
>Environment:
>Description:
 Original-Message-ID: <390CCA10.D2C4F1AE@roguewave.com>
 Date: Sun, 30 Apr 2000 18:04:32 -0600

 Hi,

 I believe this should compile according to 3.4.3.1. It fails with g++ 2.95.2.
 The compiler has no problem if A is not a template or if the call is fully
 qualified (i.e., with N::A<int>::foo()).

 Thanks
 Martin

 $ cat test.cpp

 namespace N {

 template <class T>
 struct A
 {
     int foo () const;
 };

 template <class T>
 struct B: A<T>
 {
     int foo () const;
 };

 }

 int main ()
 {
     return N::B<int>().A<int>::foo ();
 }

 $ g++ test.cpp
 test.cpp: In function `int main()':
 test.cpp:21: `struct N::B<int>' has no member named `A'
 test.cpp:21: parse error before `::'

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list