Document number:  00-0028/N1251
Date:  September 5, 2000
Author:  John Spicer, Edison Design Group
 jhs@edg.com

Definition of Dependent Name

Introduction

This document contains the proposed working paper changes for the definition of dependent name. (See core issue #224.) This issue was previously discussed in N1231.

At the Tokyo meeting, the core group agreed on the direction proposed in N1231, that the "dependency" of a name should be based on its type, and not on the form of reference used, and that special rules are needed to get the desired behavior when referring to names declared within the class template itself.

Proposed Changes

Replace section 14.6.2.1 (temp.dep.type) with the following:

In the definition of a class template or a member of a class template, a name refers to the current instantiation if it is template <class T> class A { A* p1; // A is the current instantation A<T>* p2; // A<T> is the current instantiation typedef T TT; A<TT>* p3; // A<TT> is the current instantiation A<T*> p4; // A<T*> is not the current instantiation }; A name is a member of the current instantiation if it is [Example: template <class T> class A { static const int i = 5; int n1[i]; // i refers to a member of the current instantiation int n2[A::i]; // A::i refers to a member of the current instantiation int n3[A<T>::i]; // A<T>::i refers to a member of the current instantiation int f(); }; template <class T> int A<T>::f() { return i; // i refers to a member of the current instantiation } --end example]

A name is a member of an unknown specialization if the name is a qualified-id in which the nested-name-specifier names a dependent type that is not the current instantiation.

A type is dependent if it is

Note: Because typedefs do not introduce new types, but instead simply refer to other types, a name that refers to a typedef that is a member of the current instantiation is dependent only if the type referred to is dependent.

In 14.6.2.2:

Replace

with

Add the following paragraph:

End of document.