This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Templates declared in class scope
- To: egcs at cygnus dot com
- Subject: Templates declared in class scope
- From: "Reid M. Pinchback" <reidmp at mit dot edu>
- Date: Fri, 04 Sep 1998 14:49:23 -0400
- Cc: reidmp at mit dot edu
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 =
====================================================