[PATCH] D23353: [clang-tidy] Add check 'misc-use-after-move'

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 02:49:18 PDT 2016


omtcyfz added a subscriber: omtcyfz.

================
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:659
@@ +658,3 @@
+  UseAfterMove Use;
+  if (finder.find(FunctionBody, MovingCall, MovedVariable, &Use)) {
+    emitDiagnostic(MovingCall, MovedVariable, Use, this, Result.Context);
----------------
Nit: As I discussed with Alex, it is better to omit `{}` in conditional statements if the body only contains one statement. Even if it wasn't so, it'd be better to use one "style" (i.e. either always omit `{}` or always have `{}`) at least inside a single check and you have no `{}` in many places inside this file (L637, L647, L577, ...).

Just a stylistic thing, doesn't matter too much, though.


https://reviews.llvm.org/D23353





More information about the cfe-commits mailing list