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)) + return false; ---------------- alexfh wrote: > courbet wrote: > > alexfh wrote: > > > I believe you should also check (or assert) that `E` is not > > > instantiation-dependent before running the evaluator. > > Interesting. AFAICT if I don't check that , I end up warning in the cases > > when the instantiation does result in a too large constant, which is what > > we want (the user should add a cast if they want to silence this). > IIUC, expression evaluation is just not supposed to be used on > instantiation-dependent expressions. I've recently fixed a related crash > (https://reviews.llvm.org/rL355401). I guess, there's a similar possibility > here. Thanks for the pointer. 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