This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
1872. Instantiations of constexpr templates that cannot appear in constant expressionsSection: 9.2.6 [dcl.constexpr] Status: CD4 Submitter: Richard Smith Date: 2014-02-17[Adopted at the February, 2016 meeting.]
According to 9.2.6 [dcl.constexpr] paragraph 6,
If the instantiated template specialization of a constexpr function template or member function of a class template would fail to satisfy the requirements for a constexpr function or constexpr constructor, that specialization is still a constexpr function or constexpr constructor, even though a call to such a function cannot appear in a constant expression.
The restriction on appearing in a constant expression assumes the previous wording that made such a specialization non-constexpr, and a call to a non-constexpr function cannot appear in a constant expression. With the current wording, however, there is no normative restriction against calls to such specializations. 7.7 [expr.const] should be updated to include such a prohibition.
Proposed resolution (January, 2016):
Add the following bullet following 7.7 [expr.const] bulllet 2.3:
A conditional-expression e is a core constant expression unless the evaluation of e, following the rules of the abstract machine (6.10.1 [intro.execution]), would evaluate one of the following expressions:
...
an invocation of an undefined constexpr function or an undefined constexpr constructor;
an invocation of an instantiated constexpr function or constexpr constructor that fails to satisfy the requirements for a constexpr function or constexpr constructor (9.2.6 [dcl.constexpr]);
...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4