Issue2244

Title 2244. Base class access in aggregate initialization
Status open Section 14.4 [class.protected]
Submitter Richard Smith

Created on 2016-03-08.00:00:00 by admin, last changed by admin.

Messages
msg6210 (view) Date: 2018-03-15.00:00:00

Notes from the March, 2018 meeting:

CWG affirmed the earlier direction and felt that there should be an implicit object expression assumed for these cases.

msg5921 (view) Date: 2016-12-15.00:00:00

Notes from the December, 2016 teleconference:

The consensus favored accepting f and g while rejecting h.

msg5920 (view) Date: 2018-04-11.00:00:00

The rules in 14.4 [class.protected] assume an object expression, perhaps implicit, that can be used to determine whether access to protected members is permitted or not. It is not clear how that applies to aggregates and constructors. For example:

  struct A { 
  protected: 
    A(); 
  }; 
  struct B : A { 
    friend B f(); 
    friend B g(); 
    friend B h(); 
  }; 
  B f() { return {}; }     // ok? 
  B g() { return {{}}; }   // ok? 
  B h() { return {A{}}; }  // ok?
History
Date User Action Args
2018-04-11 00:00:00adminsetmessages: + msg6210
2018-02-27 00:00:00adminsetsection: 11.4 [class.protected] -> 14.4 [class.protected]
2017-02-06 00:00:00adminsetmessages: + msg5921
2016-03-08 00:00:00admincreate