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


1453. Volatile members in literal classes?

Section: 6.8  [basic.types]     Status: CD3     Submitter: Richard Smith     Date: 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.8 [basic.types] paragraph 10 as follows:

A type is a literal type if it is: