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
The new bugprone-inc-dec-in-conditions should not consider decltype() to be a reference of a variable when emitting this check.
intmain()
{
auto foo = 0;
auto bar = 0;
if (++foo < static_cast<decltype(foo)>(bar)) { }
return0;
}
[<source>:6:9: warning: incrementing and referencing a variable in a complex condition can cause unintended side-effects due to C++'s order of evaluation, consider moving the modification outside of the condition to avoid misunderstandings [bugprone-inc-dec-in-conditions]](javascript:;)
6 | if (++foo < static_cast<decltype(foo)>(bar)) { }
| ^
[<source>:6:38: note: variable is referenced here](javascript:;)
6 | if (++foo < static_cast<decltype(foo)>(bar)) { }
| ^
1 warning generated.