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++/24680] Invalid template code accepted



------- 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


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