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

2024-12-19


2030. Access of injected-class-name with template arguments

Section: 11.8.3  [class.access.base]     Status: NAD     Submitter: Mike Miller     Date: 2014-10-27

Consider the following example:

  template <typename T> struct S1 { };
  struct S2 : private S1<int> { };
  struct S3 : S2 {
    void f() {
      S1<int> s1;   // #1
    }
  };

The reference in #1 to S1 finds the injected-class-name of S1<int>, which is private in S2 and thus inaccessible in S3. However, there is implementation divergence on the treatment of this reference, with many accepting the declaration without error, presumably because of the use of the name in a template-id. Should the Standard give special treatment to this usage?

Rationale (November, 2014):

The specification is as intended, and the example is ill-formed.