Title
Access of injected-class-name with template arguments
Status
nad
Section
11.8.3 [class.access.base]
Submitter
Mike Miller

Created on 2014-10-27.00:00:00 last changed 121 months ago

Messages

Date: 2014-11-15.00:00:00

Rationale (November, 2014):

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

Date: 2022-11-20.07:54:16

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?

History
Date User Action Args
2014-11-24 00:00:00adminsetmessages: + msg5290
2014-10-27 00:00:00admincreate