This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67906] Missing warning about std::move without effect
- From: "virkony at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 Aug 2017 19:38:26 +0000
- Subject: [Bug c++/67906] Missing warning about std::move without effect
- Auto-submitted: auto-generated
- References: <bug-67906-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67906
--- Comment #2 from Nikolay Orliuk <virkony at gmail dot com> ---
Sure,
struct Value {
Value();
Value(const Value&);
Value(Value&&);
};
struct Frame {
Value value; // previously mutable
};
Frame top;
const Frame& x = top;
Value y = std::move(x.value);
https://godbolt.org/g/v24FfQ
Thank you for looking into it. Yes, there should be better names than
-Wno-effect. Maybe -Wignored-move and -Wmove-const are slightly better.
Such warning will help to identify places which become ineffecient after
changing constness of something.