C++: Exclude operator= in ExprHasNoEffect

This commit is contained in:
Jonas Jensen
2019-01-11 13:28:53 +01:00
parent 95e457cb49
commit 6385dd38cf
3 changed files with 5 additions and 4 deletions

View File

@@ -27,9 +27,6 @@
| test.c:27:9:27:10 | 33 | This expression has no effect. | test.c:27:9:27:10 | 33 | |
| test.cpp:24:3:24:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | test.cpp:9:14:9:23 | operator++ | operator++ |
| test.cpp:25:3:25:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | test.cpp:9:14:9:23 | operator++ | operator++ |
| test.cpp:62:5:62:5 | call to operator= | This expression has no effect (because $@ has no external side effects). | test.cpp:47:14:47:22 | operator= | operator= |
| test.cpp:65:5:65:5 | call to operator= | This expression has no effect (because $@ has no external side effects). | test.cpp:55:7:55:7 | operator= | operator= |
| test.cpp:91:5:91:19 | call to operator= | This expression has no effect (because $@ has no external side effects). | test.cpp:77:9:77:17 | operator= | operator= |
| volatile.c:9:5:9:5 | c | This expression has no effect. | volatile.c:9:5:9:5 | c | |
| volatile.c:12:5:12:9 | access to array | This expression has no effect. | volatile.c:12:5:12:9 | access to array | |
| volatile.c:16:5:16:7 | * ... | This expression has no effect. | volatile.c:16:5:16:7 | * ... | |

View File

@@ -88,7 +88,7 @@ struct Derived : Base {
}
// In case base class has data, now or in the future, copy that first.
Base::operator=(rhs); // GOOD [FALSE POSITIVE]
Base::operator=(rhs); // GOOD
this->m_x = rhs.m_x;
return *this;