Title
Unclear implications of const-qualification
Status
cd2
Section
9.2.9.2 [dcl.type.cv]
Submitter
UK

Created on 2009-03-03.00:00:00 last changed 144 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

Change 9.2.9.2 [dcl.type.cv] paragraph 2 as follows:

An object declared in namespace scope with a const-qualified type has internal linkage unless it is explicitly declared extern or unless it was previously declared to have external linkage. A variable of non-volatile const-qualified integral or enumeration type initialized by an integral constant expression can be used in integral constant expressions (7.7 [expr.const]). [Note: Declaring a variable const can affect its linkage (9.2.2 [dcl.stc]) and its usability in constant expressions (7.7 [expr.const]). As as described in 9.4 [dcl.init], the definition of an object or subobject of const-qualified type must specify an initializer or be subject to default-initialization. —end note]
Date: 2009-03-03.00:00:00
N2800 comment UK 89

The normative text in 9.2.9.2 [dcl.type.cv] paragraph 2 reads,

An object declared in namespace scope with a const-qualified type has internal linkage unless it is explicitly declared extern or unless it was previously declared to have external linkage. A variable of non-volatile const-qualified integral or enumeration type initialized by an integral constant expression can be used in integral constant expressions (7.7 [expr.const]).

These two sentences parallel the specifications of 9.2.2 [dcl.stc] paragraph 7 and 7.7 [expr.const]. However, the passages are not identical, leading to questions about whether the meanings are the same.

History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2685
2010-03-29 00:00:00adminsetstatus: ready -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2347
2009-11-08 00:00:00adminsetstatus: open -> ready
2009-03-03 00:00:00admincreate