Title
Volatile members in literal classes?
Status
cd3
Section
6.8 [basic.types]
Submitter
Richard Smith

Created on 2012-01-02.00:00:00 last changed 131 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

Change 6.8 [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 of non-volatile literal types.

Date: 2012-01-02.00:00:00

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
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4120
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: + msg3692
2012-01-02 00:00:00admincreate