You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D:\GitHub\STL\llvm-project\libcxx\test\std\time\time.cal\time.cal.ymdlast\time.cal.ymdlast.nonmembers\comparisons.pass.cpp(62) : warning C6294: Ill-defined for-loop. Loop body not executed.
D:\GitHub\STL\llvm-project\libcxx\test\std\time\time.cal\time.cal.ymdlast\time.cal.ymdlast.nonmembers\comparisons.pass.cpp(63) : warning C6294: Ill-defined for-loop. Loop body not executed.
This warning is usually a nuisance (complaining about loops that intentionally perform no iterations; calling them "ill-defined" isn't great either), but in this case it found actually-squirrely code 🐿️ :
I'm not sure what this code was intended to be doing. It appears that "same month, different years" previously looped from 1000 to 2000. Perhaps 1000 * 1000 = 1 million nested iterations was excessive, and the code should be looping from (say) 1000 to 1020?
The text was updated successfully, but these errors were encountered:
I'm not sure what this code was intended to be doing. It appears that "same month, different years" previously looped from 1000 to 2000. Perhaps 1000 * 1000 = 1 million nested iterations was excessive, and the code should be looping from (say) 1000 to 1020?
Not just excessive, but it exceeds the number of constexpr steps allowed by the compiler. In differfent tests I changed the range to 1000 to 1010 so I'll do the same here.
Changes the loop range to match similar tests and avoids zero
iterations. The original motivation to reduce the number of iterations
was to allow the test to be executed during constant evaluation.
Fixes: llvm#100502
Changes the loop range to match similar tests and avoids zero
iterations. The original motivation to reduce the number of iterations
was to allow the test to be executed during constant evaluation.
Fixes: #100502
Changes the loop range to match similar tests and avoids zero
iterations. The original motivation to reduce the number of iterations
was to allow the test to be executed during constant evaluation.
Fixes: llvm/llvm-project#100502
NOKEYCHECK=True
GitOrigin-RevId: 642259a2f21feffb0dc048162b4ce40b1e5a303d
Recently introduced by @mordante's #98169.
MSVC's
/analyze
complains:This warning is usually a nuisance (complaining about loops that intentionally perform no iterations; calling them "ill-defined" isn't great either), but in this case it found actually-squirrely code 🐿️ :
llvm-project/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
Lines 61 to 68 in 7e7a906
I'm not sure what this code was intended to be doing. It appears that "same month, different years" previously looped from 1000 to 2000. Perhaps 1000 * 1000 = 1 million nested iterations was excessive, and the code should be looping from (say) 1000 to 1020?
The text was updated successfully, but these errors were encountered: