This is the mail archive of the gcc@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]

Templates declared in class scope



I just spotted something interesting in 19980824.  The following
code fragment:

  namespace foo {
    template <class T> struct A {};
    struct B {
      template <class T> struct A {};
    };
  }

causes egcs to complain:

  redefinition of 'struct ::foo::A<T>'

Now, in [temp] para 5 we have:
  "The name of a class template shall not be declared to refer
   to any other template, ..., in the same scope (3.3)"

but isn't template A in namespace scope while the member 
template B::A is in class scope?
 
 
====================================================
= Reid M. Pinchback                                =
= I/T Delivery, MIT                                =
=                                                  =
= Email:   reidmp@mit.edu                          =
= URL:     http://web.mit.edu/reidmp/www/home.html =
====================================================



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