[clang] [clang-tools-extra] [clang][Analysis] Handle const-qualified pointer refs in `ExprMutationAnalyzer` (PR #190421)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 07:21:33 PDT 2026


================
@@ -123,3 +125,56 @@ void pointer_in_emplacement_new() {
   // CHECK-NOT: warning
   new(ptr) int {123};
 }
+
+void takesConstPointerRef(int *const &);
+void takesConstPointerRRef(int *const &&);
+using IntPtrAlias = int *;
+typedef int *IntPtrTypedef;
+void takesAliasConstPointerRef(IntPtrAlias const &);
+void takesTypedefConstPointerRef(IntPtrTypedef const &);
+
+void ignore_const_pointer_reference_sinks() {
+  int value = 0;
+
+  int *p_local0 = &value;
+  // CHECK-MESSAGES-NOT: warning: pointee of variable 'p_local0'
----------------
vbvictor wrote:

Pleaser use existing style `// CHECK-NOT: warning` or better don't write `MESSAGES-NOT` at all

https://github.com/llvm/llvm-project/pull/190421


More information about the cfe-commits mailing list