alexfh added inline comments.

================
Comment at: 
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:50
+public:
+  CharExpressionDetector(const QualType CharType, const ASTContext &Ctx)
+      : CharType(CharType), Ctx(Ctx) {}
----------------
No need for the top-level const in the first parameter.


================
Comment at: 
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:70
+
+    // ternary where at least one branch is a likely char expression, e.g.
+    //    i < 265 ? i : ' '
----------------
nit: Please capitalize the first word.


================
Comment at: 
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:115
+    Expr::EvalResult EvalResult;
+    if (!E->EvaluateAsInt(EvalResult, Ctx, Expr::SE_AllowSideEffects))
+      return false;
----------------
I believe you should also check (or assert) that `E` is not 
instantiation-dependent before running the evaluator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59360



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

Reply via email to