Title
Are const volatile variables considered "constant expressions"?
Status
tc1
Section
9.2.9.2 [dcl.type.cv]
Submitter
Judy Ward

Created on 1998-12-15.00:00:00 last changed 263 months ago

Messages

Date: 1999-10-15.00:00:00

Proposed Resolution (10/99): Change the referenced text in paragraph 2 of 9.2.9.2 [dcl.type.cv] to read:

    A variable of non-volatile const-qualified ...
Date: 2022-11-20.07:54:16

The following code does not compile with the EDG compiler:

    volatile const int a = 5;
    int b[a];
The standard, 9.2.9.2 [dcl.type.cv] , says:
A variable of const-qualified integral or enumeration type initialized by an integral constant expression can be used in integral constant expressions.
This doesn't say it can't be const volatile-qualified, although I think that was what was intended.

Proposed Resolution (10/99): Change the referenced text in paragraph 2 of 9.2.9.2 [dcl.type.cv] to read:

    A variable of non-volatile const-qualified ...
History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-02-23 00:00:00adminsetmessages: + msg297
2000-02-23 00:00:00adminsetstatus: ready -> dr
1998-12-15 00:00:00admincreate