[Bug c++/24680] Invalid template code accepted
rnewman at compubrite dot com
gcc-bugzilla@gcc.gnu.org
Sat Nov 5 01:55:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list