This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24680] Invalid template code accepted
- From: "rnewman at compubrite dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Nov 2005 01:55:22 -0000
- Subject: [Bug c++/24680] Invalid template code accepted
- References: <bug-24680-8671@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from rnewman at compubrite dot com 2005-11-05 01:55 -------
But 14.6.2.1 says: "Inside a template, some constructs have semantics which may
differ from one instantiation to another. Such a construct depends on the
template parameters."
14.6.2.2 [Example
template <class T> struct X : B<T> {
typename T::A* pa;
void f(B<T>* pb) {
static int i = B<T>::i;
pb->j++;
}
};
the base class name B<T>, the type name T::A, the names B<T>::i and pb->j
explicitly depend on the _template-parameter_. -- end example]
There is no explicit dependence for List<T>::D on the template parameter. The
semantics of D do not change depending upon the instantiation of T.
I believe point two refers to this kind of construct:
List::D<T>
"-- a _qualified-id_ with a _nested-name-specifier_ which contains a
class-name that names a dependent type...." IOW: if the nested name depends on
the template arg, then the nesting entity does too. But not the other way
around.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24680