This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Adopted at the February, 2016 meeting.]
According to 6.8.6 [basic.stc] paragraph 3,
The storage duration categories apply to references aswell. The lifetime of a reference is its storage duration.
This is clearly not correct; references can have staticstorage duration but be dynamically initialized. Consider anexample like:
extern int& r1; int& f(); int& r2 = r1; // #1 int& r1 = f(); int i = r2; // #2
r1 is not initialized until after its use at #1, sothe initialization ofr2 should produce undefinedbehavior, as should the use ofr2 at #2.
The description of the lifetime of a reference should bedeleted from 6.8.6 [basic.stc] and it should be describedproperly in 6.8.4 [basic.life].
Proposed resolution (September, 2015):
Change 6.8.6 [basic.stc] paragraph 3 as follows:
The storage duration categories apply to references as well.The lifetimeof a reference is its storage duration.
Change 6.8.4 [basic.life] paragraph 1 as follows:
Thelifetime of an objector reference is a runtimeproperty of the objector reference. An object is said tohave...
Add the following as a new paragraph following6.8.6 [basic.stc] paragraph 2:
[Note: The lifetime of an array object starts as soon as storagewith proper size and alignment is obtained, and its lifetime ends when thestorage which the array occupies is reused orreleased. 11.9.3 [class.base.init] describes the lifetime of base andmember subobjects. —end note]
The lifetime of a reference begins when its initialization iscomplete. The lifetime of a reference ends as if it were a scalarobject.
Change 6.8.4 [basic.life] paragraph 3 as follows:
The properties ascribed to objectsand references throughoutthis International Standard apply for a given objectorreference only during its lifetime. [Note:...
Change Clause 7 [expr] paragraph 5 as follows:
If an expression initially has the type “referencetoT” (9.3.4.3 [dcl.ref],9.5.4 [dcl.init.ref]), the type is adjusted toT prior toany further analysis. The expression designates the object or functiondenoted by the reference, and the expression is an lvalue or an xvalue,depending on the expression.[Note: Before the lifetime ofthe reference has started or after it has ended, the behavior isundefined (see 6.8.4 [basic.life]). —end note]
Drafting note: there is no change to 6.8.4 [basic.life] paragraph 4:
A program may end the lifetime of any object by reusing the storage whichthe object occupies or by explicitly calling the destructor for an objectof a class type with a non-trivial destructor. For an object of a classtype...