Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | void moveToConstReferenceNegatives() { | ||||
// No warning inside of macro expansions. | // No warning inside of macro expansions. | ||||
M3(NoMoveSemantics, no_move_semantics); | M3(NoMoveSemantics, no_move_semantics); | ||||
// No warning inside of macro expansion, even if the macro expansion is inside | // No warning inside of macro expansion, even if the macro expansion is inside | ||||
// a lambda that is, in turn, an argument to a macro. | // a lambda that is, in turn, an argument to a macro. | ||||
CALL([no_move_semantics] { M3(NoMoveSemantics, no_move_semantics); }); | CALL([no_move_semantics] { M3(NoMoveSemantics, no_move_semantics); }); | ||||
} | } | ||||
class MoveOnly { | |||||
public: | |||||
MoveOnly(const MoveOnly &other) = delete; | |||||
MoveOnly &operator=(const MoveOnly &other) = delete; | |||||
MoveOnly(MoveOnly &&other) = default; | |||||
MoveOnly &operator=(MoveOnly &&other) = default; | |||||
}; | |||||
template <class T> | |||||
void Q(T); | |||||
void moveOnlyNegatives(MoveOnly val) { | |||||
Q(std::move(val)); | |||||
} |