[clang] [clang-tools-extra] [clang-tidy] Add support for use-after-suspend to bugprone-use-after-move (PR #172566)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 7 09:05:32 PST 2026


================
@@ -421,22 +445,25 @@ static void emitDiagnostic(const Expr *MovingCall, const DeclRefExpr *MoveArg,
   const SourceLocation MoveLoc = MovingCall->getExprLoc();
 
   Check->diag(UseLoc,
-              "'%0' used after it was %select{forwarded|moved|invalidated}1")
+              "'%0' used after %select{it was forwarded|it was moved|it was "
+              "invalidated|a suspension point}1")
       << MoveArg->getDecl()->getName() << Type;
-  Check->diag(MoveLoc, "%select{forward|move|invalidation}0 occurred here",
+  Check->diag(MoveLoc,
+              "%select{forward|move|invalidation|suspension}0 occurred here",
               DiagnosticIDs::Note)
       << Type;
   if (Use.EvaluationOrderUndefined) {
     Check->diag(
         UseLoc,
-        "the use and %select{forward|move|invalidation}0 are unsequenced, i.e. "
+        "the use and %select{forward|move|invalidation|suspension}0 are "
+        "unsequenced, i.e. "
         "there is no guarantee about the order in which they are evaluated",
----------------
higher-performance wrote:

Done.

https://github.com/llvm/llvm-project/pull/172566


More information about the cfe-commits mailing list