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
2299. constexpr vararg functionsSection: 9.2.6 [dcl.constexpr] Status: CD5 Submitter: Daveed Vandevoorde Date: 2016-04-11[Accepted as a DR at the March, 2018 (Jacksonville) meeting.]
It is not clear whether a constexpr function can be a vararg function or not. In particular, it is unclear if va_list is a literal type and whether va_start, va_arg, and va_end produce constant expressions.
Proposed resolution (November, 2017)
Add a new bullet to the list in 7.7 [expr.const] paragraph 2, and update the text as follows:
An 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:
...
a relational (7.6.9 [expr.rel]) or equality (7.6.10 [expr.eq]) operator where the result is unspecified; or
a throw-expression (7.6.18 [expr.throw]) . ; or
an invocation of the va_arg macro (17.14.2 [cstdarg.syn]).
If e satisfies the constraints of a core constant expression, but evaluation of e would evaluate an operation that has undefined behavior as specified in Clause 16 [library] through Clause 32 [thread] of this document, or an invocation of the va_start macro (17.14.2 [cstdarg.syn]), it is unspecified whether e is a core constant expression.
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