https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67906

            Bug ID: 67906
           Summary: Missing warning about std::move without effect
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: virkony at gmail dot com
  Target Milestone: ---

It would be nice to have something like -Wno-effect which will issue warnings
on usage of std::move for objects that cannot be moved.

See also http://stackoverflow.com/q/28595117/230744

I assume that it may require introducing differentiation between
explicit-rvalue (through std::move()/cast) and implicit-rvalue.

This may save from errors like:

```
const Frame& x = stack.top();
Value y = std::move(x.value); // x.value - non-mutable
```

Though there might be a false-positives in template functions or when developer
expects that in future function will have move overload for that argument.

Reply via email to