Title
Clarify constexpr for defaulted functions
Status
drwp
Section
9.5.2 [dcl.fct.def.default]
Submitter
Gabriel dos Reis

Created on 2022-04-18.00:00:00 last changed 7 months ago

Messages

Date: 2023-06-20.19:34:52

Proposed resolution (approved by CWG 2023-06-17):

A function explicitly defaulted on its first declaration is implicitly inline (9.2.8 [dcl.inline]), and is implicitly constexpr (9.2.6 [dcl.constexpr]) if it satisfies the requirements for a constexpr function. [Note: Other defaulted functions are not implicitly constexpr. -- end note ]
Date: 2023-11-15.00:00:00

[Accepted as a DR at the November, 2023 meeting.]

After the application of P2448R2, 9.5.2 [dcl.fct.def.default] paragraph 3 reads:

A function explicitly defaulted on its first declaration is implicitly inline (9.2.8 [dcl.inline]), and is implicitly constexpr (9.2.6 [dcl.constexpr]) if it satisfies the requirements for a constexpr function.

It is unclear that no other such defaulted function is implicitly constexpr.

History
Date User Action Args
2024-04-05 21:43:46adminsetstatus: dr -> drwp
2023-12-19 10:15:28adminsetstatus: ready -> dr
2023-11-10 14:27:11adminsetstatus: tentatively ready -> ready
2023-06-20 19:34:52adminsetstatus: open -> tentatively ready
2022-04-18 19:35:48adminsetmessages: + msg6802
2022-04-18 00:00:00admincreate