This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51706] default copy assignment incorrectly deleted
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 15 Jan 2012 12:46:47 +0000
- Subject: [Bug c++/51706] default copy assignment incorrectly deleted
- Auto-submitted: auto-generated
- References: <bug-51706-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51706
Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-01-15 12:46:47 UTC ---
(In reply to comment #0)
> If a move constructor is defined, then the copy assignment operator is deleted,
> even if a copy constructor is defined.
>
> In the n3092 draft, it is:
> 12.8 "Copying and moving class objects" [class.copy], paragraphs 20,25
> which doesn't say move constructors should affect copy assignment.
Note that n3092 is outdated, the last C++11 draft was n3290 and I'm referring
to it in the following.
The compiler is correct to declare the copy assignment operator as deleted in
this case, see [class.copy] p18:
"If the class definition does not explicitly declare a copy assignment
operator, one is declared implicitly. If the class definition declares a move
constructor or move assignment operator, the implicitly declared copy
assignment operator is defined as deleted; [..]"
I suggest to close this bug as INVALID.