This revision was automatically updated to reflect the committed changes.
courbet marked an inline comment as done.
Closed by commit rL356871: [clang-tidy] Fix more false positives for
bugprone-string-integer-assignment (authored by courbet, committed by ).
Herald added a project: LLVM.
Herald
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
LG. Thanks for improving the check!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59360/new/
https://reviews.llvm.org/D59360
courbet updated this revision to Diff 191885.
courbet added a comment.
Ignore template contexts and add a test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59360/new/
https://reviews.llvm.org/D59360
Files:
courbet marked 2 inline comments as done.
courbet added inline comments.
Comment at:
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:115
+Expr::EvalResult EvalResult;
+if (!E->EvaluateAsInt(EvalResult, Ctx, Expr::SE_AllowSideEffects))
+
alexfh added inline comments.
Comment at:
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:115
+Expr::EvalResult EvalResult;
+if (!E->EvaluateAsInt(EvalResult, Ctx, Expr::SE_AllowSideEffects))
+ return false;
courbet wrote:
>
courbet updated this revision to Diff 190610.
courbet added a comment.
Address review comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59360/new/
https://reviews.llvm.org/D59360
Files:
courbet marked 3 inline comments as done.
courbet added inline comments.
Comment at:
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:115
+Expr::EvalResult EvalResult;
+if (!E->EvaluateAsInt(EvalResult, Ctx, Expr::SE_AllowSideEffects))
+
alexfh added inline comments.
Comment at:
clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp:50
+public:
+ CharExpressionDetector(const QualType CharType, const ASTContext )
+ : CharType(CharType), Ctx(Ctx) {}
No need for the top-level
courbet created this revision.
courbet added reviewers: JonasToth, alexfh, xazax.hun.
Herald added subscribers: jdoerfert, rnkovacs.
Herald added a project: clang.
And add various tests gleaned for our codebase.
See PR27723.
Repository:
rG LLVM Github Monorepo