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

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

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

Priority: 2

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

View all issues with NAD 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.

[2026-02-18; Reflector poll.]

Set priority to 2 after reflector poll.

Split between P1 and NAD votes. Not supporting is_deleted for templates is consistent with the current design, as we also do not support parameter reflection or allow querying has_ellipsis_parameter.

[2026-02-20; LWG telecon; Status changed: New → NAD.]

The current design does not support querying anything about function templates. The ability to use these functions on function templates should be considered in tandem with querying other properties like parameters, etc.

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.