This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


1688. Volatile constexpr variables

Section: 9.2.6  [dcl.constexpr]     Status: NAD     Submitter: Daniel Krügler     Date: 2013-05-18

There does not appear to be language in the current wording stating that constexpr cannot be applied to a variable of volatile-qualified type. Also, the wording in 7.7 [expr.const] paragraph 2 referring to “a non-volatile object defined with constexpr” might lead one to infer that the combination is permitted but that such a variable cannot appear in a constant expression. What is the intent?

Rationale (September, 2013):

The combination is intentionally permitted and could be used in some circumstances to force constant initialization.