ztamas marked 3 inline comments as done.
ztamas added inline comments.

================
Comment at: test/clang-tidy/bugprone-too-small-loop-variable.cpp:6
+void voidBadForLoop() {
+  for (int i = 0; i < size(); ++i) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: loop variable has a narrower 
type ('int') than the type ('long') of termination condition 
[bugprone-too-small-loop-variable]
----------------
JonasToth wrote:
> ztamas wrote:
> > JonasToth wrote:
> > > please add tests where the rhs is a literal.
> > Do you mean tests like voidForLoopWithLiteralCond()?
> > Is it worth to add more tests like that?
> I didn't see it. In principle yes, but i would like to see a test with a 
> bigger number then iterateable (maybe there is a frontend warning for that?). 
> If there is no warning, this should definitely be implemented here (possible 
> follow up) or even become a frontend warning.
I added a test case. This kind of test cases are caught by 
-Wtautological-constant-out-of-range-compare, so we are good I think.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53974



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

Reply via email to