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
@@ -622,3 +622,31 @@ void test_volatile_concrete_address(int i, int size) {
622
622
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (size) are updated in the loop body [bugprone-infinite-loop]
623
623
}
624
624
}
625
+
626
+
template <typename T>
627
+
intsome_template_fn() { return1; }
628
+
629
+
template <typename T>
630
+
voidtest_dependent_condition() {
631
+
constint error = some_template_fn<T>();
632
+
do {
633
+
} while (false && error == 0);
634
+
635
+
constint val = some_template_fn<T>();
636
+
for (; !(val == 0 || true);) {
637
+
}
638
+
639
+
constint val2 = some_template_fn<T>();
640
+
for (; !(val2 == 0 || false);) {
641
+
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (val2) are updated in the loop body [bugprone-infinite-loop]
642
+
}
643
+
644
+
constint val3 = some_template_fn<T>();
645
+
do {
646
+
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (val3) are updated in the loop body [bugprone-infinite-loop]
0 commit comments