https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
Jonathan Wakely changed:
What|Removed |Added
CC||nunoplopes at sapo dot pt
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
Jonathan Wakely changed:
What|Removed |Added
Ever confirmed|0 |1
Severity|normal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
--- Comment #6 from Antony Polukhin ---
Another way to workaround the warning is to use something like
`my_class(my_class&) requires false;`. That's too ugly to use.
I'd be fine with closing this issue as a 'won't fix'.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
--- Comment #5 from Jonathan Wakely ---
No, because that would mean almost every class written for C++03 would fail to
compile in C++11 or later, which would be absurd.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
--- Comment #4 from Igor Klevanets ---
(In reply to Jonathan Wakely from comment #3)
> X x2 = std::move(x1); // calls copy constructor
Excuse me.
I was sure that standard tells this row to fail compitaion
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
--- Comment #3 from Jonathan Wakely ---
You're mistaken.
struct X
{
std::string str = "not empty";
X() = default;
X(const X&) = default;
};
This type does not have a move constructor. Copying an rvalue will perform a
copy (not a move):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
Igor Klevanets changed:
What|Removed |Added
CC||cerevra at yandex dot ru
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89700
--- Comment #1 from Jonathan Wakely ---
(In reply to Antony Polukhin from comment #0)
> The rules for the warning could be following:
> Issue a warning if at least one of the class members has a move constructor,
> class has a copy constructor an