Title
`is_consteval_only` preconditions are too weak
Status
ready
Section
[meta.unary.prop]
Submitter
Tim Song

Created on 2026-03-05.00:00:00 last changed yesterday

Messages

Date: 2026-03-06.17:21:52

Proposed resolution:

This wording is relative to N5032.

  1. Combine [meta.unary.prop] p4-5 into one paragraph with a bullet list, then add a new bullet, as indicated:

    -4- For the purpose of defining the templates in this subclause,:

    • (4.1) — a function call expression declval<T>() for any type `T` is considered to be a trivial ([depr.meta.types], [special]) function call that is not an odr-use ([basic.def.odr]) of `declval` in the context of the corresponding definition notwithstanding the restrictions of [declval].

    • (4.2) — -5- For the purpose of defining the templates in this subclause, let VAL<T> for some type `T` be an expression defined as follows:

      • (5.14.2.1) — […]

      • (5.24.2.2) — […]

    • (4.3) — let `C(T)` be the set of types defined as follows:

      • (4.3.1) — if remove_cv_t<T> is the type "array of `U`", "pointer to `U`", or "reference to `U`", then `C(T)` is `C(U)`;

      • (4.3.2) — otherwise, if remove_cv_t<T> is the type "pointer to member of class `X` of type `U`", then `C(T)` is the union of `C(X)` and `C(U)`;

      • (4.3.3) — otherwise, if `T` is the type "`noexcept`opt function of parameter-type-list cv-qualifier-seqopt ref-qualifieropt returning `U`", then `C(T)` is the union of `C(U)` and `C(X)` for each type `X` in the parameter-type-list;

      • (4.3.4) — otherwise, if remove_cv_t<T> is a complete class type, then `C(T)` is the union of the sets `C(U)`, for each `U` that is the type of a (possibly indirect) non-static data member of remove_cv_t<T>;

      • (4.3.5) — otherwise, `C(T)` is the set containing the single element remove_cv_t<T>.

  2. Modify [tab:meta.unary.prop], Table 54 — Type property predicates as indicated:

    TemplateConditionPreconditions
    template<class T>
    struct is_consteval_only;
    T is consteval-only ([basic.types.general]) remove_all_extents_t<T> shall be a complete type or _cv_ `void`. If `C(T)` does not contain `std::meta::info`, then it shall not contain an incomplete class type.
Date: 2026-03-06.00:00:00

[ 2026-03-06 LWG telecon; move to Ready ]

Date: 2026-03-05.00:00:00
Addresses US 81-149.

The precondition for `is_consteval_only` is insufficient. A definitive false answer requires every type that `T` is compounded from to be complete or cv void.

History
Date User Action Args
2026-03-06 17:21:52adminsetmessages: + msg16011
2026-03-06 17:21:52adminsetstatus: new -> ready
2026-03-06 10:40:28adminsetmessages: + msg16003
2026-03-05 00:00:00admincreate