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


2910. Effect of requirement-parameter-lists on odr-usability

Section: 6.3  [basic.def.odr]     Status: DR     Submitter: Hubert Tong     Date: 2024-06-24

[Accepted as a DR at the November, 2024 meeting.]

(From submission #561.)

Consider:

  bool f() {
    constexpr int z = 42;
    return requires {
      sizeof(int [*&z]);
    } && requires (int x) {
      sizeof(int [*&z]);
    };
  }

The second requires-expression introduces a function parameter scope according to 6.4.4 [basic.scope.param]. This affects odr-usability as specified in 6.3 [basic.def.odr] paragraph 10, but the two requires-expression in the example ought to actually behave the same.

Proposed resolution (approved by CWG 2024-11-19):

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

A local entity (6.1 [basic.pre]) is odr-usable in a scope (6.4.1 [basic.scope.scope]) if: