Title
§[meta.reflection.queries] `is_deleted` on function templates
Status
new
Section
[meta.reflection.queries]
Submitter
Jakub Jelinek

Created on 2025-12-18.00:00:00 last changed 1 week ago

Messages

Date: 2025-12-20.15:56:05

Proposed resolution:

This wording is relative to N5032.

  1. Modify [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 ([dcl.fct.def.delete]) or defaulted function ([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 ([dcl.fct.def.default]). Otherwise, `false`.

Date: 2025-12-18.00:00:00

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 [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 ([dcl.fct.def.delete]) or defaulted function ([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 ([dcl.fct.def.delete]) or defaulted function ([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 ([dcl.fct.def.delete]) or defaulted function ([dcl.fct.def.default]), respectively. Otherwise, `false`.

History
Date User Action Args
2025-12-20 15:56:05adminsetmessages: + msg15838
2025-12-18 00:00:00admincreate