This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67906] Missing warning about std::move without effect


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]