nickdesaulniers added a comment.

Thanks for the patch!



================
Comment at: clang/lib/Sema/SemaChecking.cpp:1134
   };
+  auto ProcessFormatStringLiteral =
+      [&](const Expr *FormatExpr, StringRef &FormatStrRef, size_t &StrLen) {
----------------
naive question, so will we create a lambda with capture even though a few cases 
in the switch below will never use it?


================
Comment at: clang/lib/Sema/SemaChecking.cpp:1324
     SourceSize = ComputeExplicitObjectSizeArgument(1);
     DestinationSize = ComputeSizeArgument(0);
+    const auto *FormatExpr = TheCall->getArg(/*Arg=*/2)->IgnoreParenImpCasts();
----------------
Can `DestinationSize` be calculated later, after the `if (SourceSize && ...`? 
Seems it's not needed unless that condition is false?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158562/new/

https://reviews.llvm.org/D158562

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to