Specifications for variables that should also apply to references
6.1 [basic.pre]
Alisdair Meredith

Created on 2007-05-17.00:00:00 last changed 150 months ago


Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting as document N2993.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

See paper PL22.16/09-0183 = WG21 N2993. This resolution also resolves issue 570.

Date: 2008-09-15.00:00:00

Notes from the September, 2008 meeting:

The CWG expressed interest in an approach that would define “variable” to include both objects and references and to use that for both this issue and issue 570.

Date: 2022-02-18.07:47:23
N2800 comment UK 22

There are a number of specifications in the Standard that should also apply to references. For example:

  • 6.1 [basic.pre] paragraphs 3-4 indicate that a reference cannot have a name because it is not an entity. (See also issue 485.)

  • 6.5.3 [basic.lookup.unqual] paragraph 13 covers unqualified lookup in the initializer of a variable member of a namespace but not that of a reference member of a namespace. It would be very strange if the lookup in these two cases were different.

  • 6.6 [basic.link] paragraph 8 prohibits use of a type without linkage as the type of a variable with linkage, but not as the type of a reference with linkage. (References with linkage are explicitly mentioned earlier in the section.)

  • [basic.stc.static] paragraph 3 permits local static variables but not local static references.

A number of other examples could be cited. A thorough review is needed to make sure that references are completely specified.

Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2655
2010-03-29 00:00:00adminsetstatus: tentatively ready -> cd2
2009-11-08 00:00:00adminsetstatus: drafting -> tentatively ready
2008-10-05 00:00:00adminsetmessages: + msg1771
2008-10-05 00:00:00adminsetstatus: review -> drafting
2008-05-18 00:00:00adminsetmessages: + msg1642
2008-05-18 00:00:00adminsetstatus: drafting -> review
2007-08-05 00:00:00adminsetstatus: open -> drafting
2007-05-17 00:00:00admincreate