Title
Missing integration of direct base class relationships
Status
ready
Section
7.5.9 [expr.prim.splice]
Submitter
US

Created on 2025-10-01.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-05.18:26:26

Proposed resolution (approved by CWG 2025-11-05):

  1. Change in 6.3 [basic.def.odr] bullet 3.3 as follows:

    • ...
    • If E is a class member access expression (7.6.1.5 [expr.ref]) of the form E1 . templateopt E2 naming , where E2 designates a non-static data member or a direct base class relationship, the set contains the potential results of E1.
    • ...
  2. Change in 7.2.1 [basic.lval] bullet 1.1 as follows:

    • A glvalue is an expression whose evaluation determines the identity of an object, function, or non-static data member, or direct base class relationship.
    • ...
  3. Insert a paragraph before 7.5.5.1 [expr.prim.id.general] paragraph 5 as follows:

    A splice-expression that designates a direct base class relationship shall appear only as the second operand of a class member access.

    For an id-expression that denotes an overload set, overload resolution is performed ...

  4. Insert before 7.5.9 [expr.prim.splice] bullet 2.4 as follows:

    • Otherwise, if S is a direct base class relationship (D, B), the expression is an lvalue designating S. The expression has the type B.
    • Otherwise, if S is a variable or a structured binding, ...
  5. Change in 7.6.1.5 [expr.ref] paragraph 10 as follows:

    If E2 designates a non-static member (possibly after overload resolution) or direct base class relationship and the result of E1 is an object whose type is not similar (7.3.6 [conv.qual]) to the type of E1, the behavior is undefined. ...
  6. Change in 12.4.6 [over.ref] paragraph 1 as follows:

    A class member access operator function is a function named operator-> that is a non-static member function taking no non-object parameters. For an expression of the form
      postfix-expression -> templateopt id-expression
    
    the operator function is selected by overload resolution (12.2.2.3 [over.match.oper]), and the expression is interpreted as
      ( postfix-expression . operator -> () ) -> templateopt id-expression
    
    Analogously, for an expression of the form
      postfix-expression -> splice-expression
    
    the operator function is selected by overload resolution, and the expression is interpreted as
      ( postfix-expression . operator -> () ) -> splice-expression
    
  7. Change in 13.8.3.3 [temp.dep.expr] paragraph 5 as follows:

    A class member access expression (7.6.1.5 [expr.ref]) is type-dependent if
    • the terminal name of its id-expression, if any, is dependent,
    • its splice-expression, if any, is type-dependent, or
    • the expression refers to a member of the current instantiation and the type of the referenced member is dependent.
Date: 2025-11-05.18:26:26
N5028 comment USĀ 27-059

(From submissions #777 and #778.)

Subclause 7.5.9 [expr.prim.splice] paragraph 2 makes no provision for splicing a reflection representing a direct base class relationship, yet 7.6.1.5 [expr.ref] bullet 8.6 presupposes that this is possible.

Furthermore, 6.3 [basic.def.odr] paragraph 3 does not consider direct base class relationships, nor does 13.8.3.3 [temp.dep.expr] paragraph 5.

History
Date User Action Args
2025-11-06 23:04:52adminsetstatus: tentatively ready -> ready
2025-11-05 18:26:26adminsetmessages: + msg8217
2025-11-05 18:26:26adminsetstatus: review -> tentatively ready
2025-11-04 06:25:50adminsetstatus: open -> review
2025-10-01 00:00:00admincreate