This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4495. §[meta.reflection.queries] is_deleted on function templates

Section: 21.4.7 [meta.reflection.queries] Status: New Submitter: Jakub Jelinek Opened: 2025-12-18 Last modified: 2025-12-20

Priority: Not Prioritized

View all other issues in [meta.reflection.queries].

View all issues with New status.

Discussion:

In gcc-patches/2025-December/704059 Jason Merrill mentioned that std::meta::is_deleted should be able to query also deleted function templates, not just deleted functions.

According to 21.4.7 [meta.reflection.queries] p15

consteval bool is_deleted(info r);
consteval bool is_defaulted(info r);

Returns: true if r represents a function that is a deleted function (9.6.3 [dcl.fct.def.delete]) or defaulted function (9.6.2 [dcl.fct.def.default]), respectively. Otherwise, false.

and as I think is_defaulted on function templates makes no sense, that would mean changing that to

consteval bool is_deleted(info r);

Returns: true if r represents a function or function template that is a deleted function (9.6.3 [dcl.fct.def.delete]) or defaulted function (9.6.2 [dcl.fct.def.default]), respectively. Otherwise, false.

consteval bool is_defaulted(info r);

Returns: true if r represents a function that is a deleted function (9.6.3 [dcl.fct.def.delete]) or defaulted function (9.6.2 [dcl.fct.def.default]), respectively. Otherwise, false.

Proposed resolution:

This wording is relative to N5032.

  1. Modify 21.4.7 [meta.reflection.queries] as indicated:

    consteval bool is_deleted(info r);
    consteval bool is_defaulted(info r);
    

    -15- Returns: true if r represents a function or function template that is a deleted function (9.6.3 [dcl.fct.def.delete]) or defaulted function (9.6.2 [dcl.fct.def.default]), respectively. Otherwise, false.

    consteval bool is_defaulted(info r);
    

    -?- Returns: true if r represents a function that is a defaulted function (9.6.2 [dcl.fct.def.default]). Otherwise, false.