Value-initialization of a reference
9.4 [dcl.init]
Steve Adamczyk

Created on 2001-07-25.00:00:00 last changed 228 months ago


Date: 2001-10-15.00:00:00

Proposed resolution (10/01):

Add the indicated wording to the indicated sentence in 9.4 [dcl.init] paragraph 5:

A program that calls for default-initialization or value-initialization of an entity of reference type is ill-formed.
Date: 2004-09-10.00:00:00

Another glitch in the TC1/core issue 178 definition of value-initialization: it's no longer an error to value-initialize a reference. That makes an example like

typedef struct { int &r; } S;
int main() {
  S();  // Error in C++98, okay in TC1!
valid, which has got to be wrong. See 9.4 [dcl.init] paragraph 5, where there is wording that forbids default-initialization of a reference, but not value-initialization thereof. As noted in issue 302, if the default constructor were required to be generated when a value-initialization is done, that would force an error.

Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2002-05-10 00:00:00adminsetstatus: review -> dr
2001-11-09 00:00:00adminsetmessages: + msg555
2001-11-09 00:00:00adminsetstatus: open -> review
2001-07-25 00:00:00admincreate