[Bug c++/53096] New: [c++11] should be possible to default a copy ctor that takes non-const arg
eric.niebler at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 23 23:06:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53096
Bug #: 53096
Summary: [c++11] should be possible to default a copy ctor that
takes non-const arg
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: eric.niebler@gmail.com
The following code does not compile:
struct foo
{
foo() = default;
foo(foo &) = default; // ERROR HERE
foo(foo const &) = default;
};
The error is:
error: ‘foo::foo(foo&)’ declared to take non-const reference
cannot be defaulted in the class body
This was correct for the FDIS, but is now incorrect given the resolution for
core issue 1333:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1333
The code above should be accepted.
More information about the Gcc-bugs
mailing list