================
@@ -0,0 +1,29 @@
+// RUN: %clang_analyze_cc1 %s \
+// RUN:   -analyzer-checker=core,debug.ExprInspection \
+// RUN:   -verify
----------------
NagyDonat wrote:

Please add a second `RUN:` configuration that demonstrates the difference 
between C and C++ by also analyzing this test in C++ mode (I hope that 
`std=c++whatever` works even if the file is named `something.c`).

You can use `-verify=expected,c` and `-verify=expected,cpp` on the two run 
lines to be able to say `c-warning` and `cpp-warning` for warnings that are 
only emitted in C or C++ (and `expected-warning` will denote a warning that 
appears in both C and C++). 

As the self-assignments would cause warnings in C++, you will probably need to 
move them into separate functions (`self_assign_int`, `self_assign_ptr` etc.).

You can also include the reference self-assignment in `#ifdef __cplusplus`.

https://github.com/llvm/llvm-project/pull/187530
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to