================
@@ -1026,3 +1026,12 @@ void unsigned_concrete_int_no_crash(void) {
clang_analyzer_express(y); // expected-warning {{$y}}
clang_analyzer_express(x == y); // expected-warning {{$x + 1U == $y + 1U}}
}
+
+void add_shifted_same_symbol(void) {
+ int x = f();
+ clang_analyzer_denote(x, "$x");
+ clang_analyzer_express((x + 1) + (x + 2)); // expected-warning{{$x + $x + 3}}
+ clang_analyzer_express((x + 1) + x); // expected-warning{{$x + $x + 1}}
----------------
NagyDonat wrote:
It is unfortunate that `clang_analyzer_express` doesn't print parentheses to
disambiguate between e.g. `($x + $x) + 3` and `$x + ($x + 3)`, but it is still
sufficient in this regression test against this particular bug.
Maybe later we should improve it to print parentheses, but it would break the
tests that rely on it (roughly 500 calls in 8 test files).
https://github.com/llvm/llvm-project/pull/237160
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits