This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/13967] [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules


------- Additional Comments From gdr at integrable-solutions dot net  2004-02-02 01:31 -------
Subject: Re:  [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules

"gianni at mariani dot ws" <gcc-bugzilla@gcc.gnu.org> writes:

|  Gabriel Dos Reis writes:
| || Nonetheless - it's still a boog.
| |
| |Where? in como or in GCC?
| 
| .. I believe it's GCC that gets it wrong.

If there is a bug in GCC, I think it is only about the wording of the
diagnostic, not the fact of rejecting the code.   

| | ..  Member functions defined in a class
| | definition get rewritten as if they were defined outside of the class.
| | And it is clear that when you rewrite the function outside of the
| | class definition (which is what GCC does), then you find X::C, not the
| | template parameter.
| 
| But when it gets expanded, there should be no "X::C" symbol in the template
| whatsoever as this is should be substituted with the template parameter.  Did I
| miss somthing ?

I'm not talking about the instantiation.  I'm talking about the
definition. E.g. when you write

   struct X
   {
     struct C { int x; };

     template<typename T,  typename A, template<typename,typename> class C>
       C<T, A> Func()
     {
       return C<T, A>();
     }
   };

It gets rewritten as

  struct X
  {
     struct C;
     template<class T, class A, template<class, class> class C>
     C<T, A> Func();
  };

  struct A::C { int x; };

  template<class T, class A, template<class, class> class C>
  C<T, A> X::Func()
  {
    return C<T, A>();   // #1
  }

and at line #1, the standard says that X::C should be found.

-- Gaby


-- 


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


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