This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/35: Re: gcc-2.9[56] lookup problem



>Number:         35
>Category:       c++
>Synopsis:       [not accepted] gcc-2.9[56] lookup problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 04 13:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Pierre Aubert <paubert@pcmath03.insa-lyon.fr>
>Release:        2.95.2
>Organization:
C.I.S.M.  Universite Claude Bernard Lyon 1 / INSA de Lyon
>Environment:
>Description:
 Date: 19 Aug 1999 12:12:10 +0200
 
 bug report 
 platform independant. it does not compile with all the egcs
 versions I have access to.

 ----------------------------------------------------------------------
 template <short B,short E>
 class R {};

 template <class T> 
 class A {
 public:
   explicit A( T const& t ) : my_t(t){ }

   template <short B,short E>
   A<T> 
   operator() ( R<B,E> const& r ) { return A<T>(my_t); }

   T get() const { return my_t; }

 private:
   T my_t;
 };



 int main() {
   A<int> a(10);
   R<1,3> r;

   // OK
   if( a.template operator()<1,3>(r).get() != 10 )
     return 1;
   // don't find it
   if ( a(r).get() != 10 ) 
     return 2;

   return 0;
 }
 ----------------------------------------------------------------------

 gcc don't find the a(r) call. Do we have to use the a.template ... call?
 aCC and KCC seem to find both calls.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]