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

Created on 2022-04-18.00:00:00 last changed 1 month ago

Messages

Date: 2022-04-18.19:35:48

Suggested resolution:

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: 2022-04-18.00:00:00

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
2022-04-18 19:35:48adminsetmessages: + msg6802
2022-04-18 00:00:00admincreate