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
[Clang] Default the warning for chained comparison to an error. (llvm#128145)
Boolean constructs of the form `a < b < c`
never express the likely intent of the user and
we have been warning on them since clang 19.
WG21 is likely to deprecate or make that construct in the future. To
gain more experience and to improve safety, this patches preempt future
language evolution by turning
warn_consecutive_comparison in an error, by default (which can be
disabled with `-Wno-error=parentheses`)
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/cxx2a-adl-only-template-id.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ int e = h<0>(q); // ok, found by unqualified lookup
27
27
voidfn() {
28
28
f<0>(q);
29
29
int f;
30
-
f<0>(q); // expected-error {{invalid operands to binary expression}} // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}
30
+
f<0>(q); // expected-error {{invalid operands to binary expression}} // expected-error {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}
0 commit comments