CWG Issue 1453 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
1453. Volatile members in literal classes?
Section: 6.9 [basic.types]Status: CD3Submitter: Richard SmithDate: 2012-01-02
[Moved to DR at the October, 2012 meeting.]
Can a literal class have a volatile member? For example,
struct S { constexpr S() : n(0) { } volatile int n; };
constexpr S s; // causes volatile write to S::n
Proposed resolution (February, 2012):
Change 6.9 [basic.types] paragraph 10 as follows:
A type is a literal type if it is:
- ...
- a class type (Clause 11 [class]) that has all the following properties:
- ...
- all of its non-static data members and base classes are ofnon-volatile literal types.