https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #9 from Jonathan Wakely ---
(In reply to Charles-Henri Gros from comment #7)
> For context, we're trying to detect cases where using "auto" unintentionally
> creates a copy (it's regrettably common).
> Here the copy is necessary to g
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #8 from Jonathan Wakely ---
(In reply to Jonathan Wakely from comment #5)
> Removing it would make the code less efficient and more complex.
In fact, I don't even see how it would be possible, except by making *another*
copy, e.g.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #7 from Charles-Henri Gros ---
For context, we're trying to detect cases where using "auto" unintentionally
creates a copy (it's regrettably common).
Here the copy is necessary to get a non-const value; that's definitely
something we
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #6 from Jonathan Wakely ---
For your reproducer, the allocator is std::allocator which is an empty
class and copying is a no-op. There is no efficiency concern whatsoever.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
Jonathan Wakely changed:
What|Removed |Added
Resolution|--- |INVALID
Status|WAITING
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #4 from Marc-André Laverdière ---
The comment is "If this allocation throws there are no effects:" and I didn't
understand the implications. Thanks for you spelled it out the logic behind it.
May I encourage you to update the comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #2 from Andrew Pinski ---
https://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2579
This copy only happens with _S_propagate_on_copy_assign which is true even.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109305
--- Comment #1 from Andrew Pinski ---
LWG2579