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

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

Messages

Date: 2025-10-12.18:26:03
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.

Possible resolution:

  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 base class.
    • ...
  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] bullet 8.6 as follows:

    • Otherwise, if E2 designates a direct base class relationship (D, B) and the type of E1 is cv T D, the expression designates the direct base class subobject of type B of the object designated by E1. If E1 is an lvalue, then E1.E2 is an lvalue; otherwise, E1.E2 is an xvalue. The type of E1.E2 is “cv B”. [Note 6: This can only occur in an expression of the form e1.[:e2:] if E2 is a splice-expression . —end note]
  6. 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.
History
Date User Action Args
2025-10-01 00:00:00admincreate