Movatterモバイル変換


[0]ホーム

URL:


Issue 304 - WG21 CWG Issues
Title
Value-initialization of a reference
Status
tc1
Section
9.5 [dcl.init]
Submitter
Steve Adamczyk

Created on2001-07-25.00:00:00 last changed277 months ago

Messages

msg555 (view)
Date: 2001-10-15.00:00:00

Proposed resolution (10/01):

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

A program that calls for default-initializationor value-initializationof an entity of reference type is ill-formed.
msg535 (view)
Date: 2004-09-10.00:00:00

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

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

History
DateUserActionArgs
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

[8]ページ先頭

©2009-2026 Movatter.jp