This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


1471. Nested type of non-dependent base

Section: 13.8.3.2  [temp.dep.type]     Status: CD3     Submitter: Johannes Schaub     Date: 2012-02-26

[Moved to DR at the April, 2013 meeting.]

Even though A::C is a nested type and member of the current instantiation, and thus dependent by the rules of 13.8.3.2 [temp.dep.type] paragraph 8, there does not seem to be a good reason for making it so:

  struct B {
   struct C { };
  };

  template<typename T> struct A : B {
   A::C c;
  };

Proposed resolution (October, 2012):

[Some existing uses of the term “member of the current instantiation” are consistent with the definition in 13.8.3.2 [temp.dep.type] paragraph 4; others are intended to refer to members of the “current instantiation,” as defined in paragraph 1. The following resolution changes the latter to use the phrase “member of a class that is the current instantiation.”]

  1. Change 13.8.3.2 [temp.dep.type] paragraph 4 as follows:

  2. A name is a member of the current instantiation if it is

    [Example: ... —end example]

    A name is a dependent member of the current instantiation if it is a member of the current instantiation which, when looked up, refers to at least one member of a class that is the current instantiation.

  3. Change 13.8.3.2 [temp.dep.type] paragraph 5 as follows:

  4. A name is a member of an unknown specialization if it is

  5. Change 13.8.3.2 [temp.dep.type] paragraph 8 as follows:

  6. A type is dependent if it is

  7. Change 13.8.3.3 [temp.dep.expr] paragraph 3 as follows:

  8. An id-expression is type-dependent if it contains

    or if it names a static data dependent member of the current instantiation that has is a static data member of type “array of unknown bound of T” for some T (13.7.2.5 [temp.static]). Expressions of the following forms...

  9. Change 13.8.3.4 [temp.dep.constexpr] paragraph 2 as follows (assumes the base text is as modified by issue 1413):

  10. An id-expression is value-dependent if:

    Expressions of the following form...

  11. Change 13.8.3.4 [temp.dep.constexpr] paragraph 5 as follows (assumes the base text is as modified by issue 1413):

  12. An expression of the form &qualified-id where the qualified-id's nested-name-specifier names a dependent member of the current instantiation is value-dependent.