Title
Wording nit on use of const variables in constant expressions
Status
cd1
Section
7.7 [expr.const]
Submitter
Mark Mitchell

Created on 2004-02-03.00:00:00 last changed 189 months ago

Messages

Date: 2005-04-15.00:00:00

[Voted into WP at April 2005 meeting.]

Date: 2004-10-15.00:00:00

Proposed resolution (October, 2004):

Change the first sentence in the second part of 7.7 [expr.const] paragraph 1 as follows:

An integral constant-expression can involve only literals of arithmetic types (5.13 [lex.literal], 6.8.2 [basic.fundamental]), enumerators, non-volatile const variables or static data members of integral or enumeration types initialized with constant expressions (9.4 [dcl.init]), non-type template parameters of integral or enumeration types, and sizeof expressions.
Date: 2004-02-03.00:00:00

I'm looking at 7.7 [expr.const]. I see:

An integral constant-expression can involve only ... const variables or static data members of integral or enumeration types initialized with constant expressions ...

Shouldn't that be "const non-volatile"?

It seems weird to say that:

  const volatile int i = 3;
  int j[i];
is valid.

Steve Adamczyk: See issue 76, which made the similar change to 9.2.9.2 [dcl.type.cv] paragraph 2, and probably should have changed this one as well.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2005-10-22 00:00:00adminsetstatus: dr -> wp
2005-05-01 00:00:00adminsetmessages: + msg1189
2005-05-01 00:00:00adminsetstatus: ready -> dr
2004-11-07 00:00:00adminsetmessages: + msg1046
2004-11-07 00:00:00adminsetstatus: drafting -> ready
2004-04-09 00:00:00adminsetstatus: open -> drafting
2004-02-03 00:00:00admincreate