Title
Allowed copy constructor signatures
Status
cd1
Section
11.4.5 [class.ctor]
Submitter
Richard Smith

Created on 2002-01-08.00:00:00 last changed 161 months ago

Messages

Date: 2003-10-15.00:00:00

[Voted into WP at October 2003 meeting.]

Date: 2002-10-15.00:00:00

Proposed resolution (October 2002):

Change 11.4.5 [class.ctor] paragraph 10 from

A copy constructor for a class X is a constructor with a first parameter of type X& or of type const X&. [Note: see _N4750_.15.8 [class.copy] for more information on copy constructors. ]
to (note that the dropping of italics is intentional):
A copy constructor (_N4750_.15.8 [class.copy]) is used to copy objects of class type.

Date: 2020-12-15.00:00:00

11.4.5 [class.ctor] paragraph 10 states

A copy constructor for a class X is a constructor with a first parameter of type X & or of type const X &. [Note: see _N4750_.15.8 [class.copy] for more information on copy constructors.]

No mention is made of constructors with first parameters of types volatile X & or const volatile X &. This statement seems to be in contradiction with _N4750_.15.8 [class.copy] paragraph 2 which states

A non-template constructor for class X is a copy constructor if its first parameter is of type X &, const X &, volatile X & or const volatile X &, ...

_N4750_.15.8 [class.copy] paragraph 5 also mentions the volatile versions of the copy constructor, and the comparable paragraphs for copy assignment (_N4750_.15.8 [class.copy] paragraphs 9 and 10) all allow volatile versions, so it seems that 11.4.5 [class.ctor] is at fault.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2004-04-09 00:00:00adminsetmessages: + msg1018
2003-11-15 00:00:00adminsetstatus: ready -> wp
2003-04-25 00:00:00adminsetstatus: review -> ready
2002-11-08 00:00:00adminsetmessages: + msg737
2002-11-08 00:00:00adminsetstatus: open -> review
2002-01-08 00:00:00admincreate