Title
Run-time treatment of std::meta::info types
Status
open
Section
6.9.2 [basic.types.trivial]
Submitter
Hubert Tong

Created on 2026-08-15.00:00:00 last changed 6 days ago

Messages

Date: 2026-08-20.14:05:04

Possible resolution:

  1. Change in 6.8.2 [intro.object] paragraph 8 as follows:

    An object has nonzero size if it
    • is not a potentially-overlapping subobject, or
    • is not neither of class type nor of type std::meta::info, or
    • is of a class type with virtual member functions or virtual base classes, or
    • has subobjects of nonzero size or unnamed bit-fields of nonzero length.
    Otherwise, if the object is a base class subobject of a standard-layout class type with no non-static data members, it has zero size. ...
  2. Change in 6.9.2 [basic.types.trivial] paragraph 1 as follows:

    Each trivially copyable type T has an implementation-defined set of discrete values. Each possible value representation of an object of type T corresponds to a distinct implementation-defined subset of this set. The union of these subsets is the set of values; for scalar types other than object pointer types and type std::meta::info, each such subset contains no more than one value. Certain operations cause an object to acquire a value representation, in which case the object's value is replaced with an unspecified member of the corresponding subset that would result in the program having defined behavior, if any.
  3. Change in 6.9.3 [basic.fundamental] paragraph 17 as follows:

    ... A reflection is said to represent the corresponding construct. The value representation (6.9.1 [basic.types.general]) of type std::meta::info comprises zero bits. ...
  4. Change in 7.3.2 [conv.lval] paragraph 3 as follows:

    The result of the conversion is determined according to the following rules:
    • If T is cv std::nullptr_t, the result is a null pointer constant (7.3.12 [conv.ptr]). [Note: ... -- end note]
    • Otherwise, if T is cv std::meta::info and the evaluation of the conversion is not constant evaluation (7.7.2 [expr.const.core]), the result is the null reflection (6.9.3 [basic.fundamental]).
    • ...
  5. Change in 22.11.3 [bit.cast] paragraph 3 as follows:

    ... Padding bits of the result are unspecified. An object of type std::meta::info among the result obtains the null reflection value. ...
Date: 2026-08-15.00:00:00

Paper P4101R1 (Consteval-only Values for C++26) allowed for values of type std::meta::info to exist at run-time, although any possibly distinct values have no meaning at run-time. See also paper P2434R5 (Nondeterministic Pointer Provenance).

History
Date User Action Args
2026-08-15 07:30:08adminsetmessages: + msg8646
2026-08-15 00:00:00admincreate