[clang] [analyzer][NFC] Fix a warning in RegionStore.cpp (PR #157630)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 9 02:10:25 PDT 2025


https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/157630

```
clang/lib/StaticAnalyzer/Core/RegionStore.cpp: warning: bitwise operation between different enumeration types ('Kind' and '(anonymous namespace)::BindingKey::(unnamed enum at clang/lib/StaticAnalyzer/Core/RegionStore.cpp)') is deprecated [-Wdeprecated-anon-enum-enum-conversion]
   XX |     : P(r, k | Symbolic), Data(reinterpret_cast<uintptr_t>(Base)) {
      |            ~ ^ ~~~~~~~~
1 warning generated.
```

>From 132764e0b7004e5d5124e77d0fcf7616a0fa95a2 Mon Sep 17 00:00:00 2001
From: Balazs Benics <benicsbalazs at gmail.com>
Date: Tue, 9 Sep 2025 11:08:47 +0200
Subject: [PATCH] [analyzer][NFC] Fix a warning in RegionStore.cpp

```
clang/lib/StaticAnalyzer/Core/RegionStore.cpp: warning: bitwise operation between different enumeration types ('Kind' and '(anonymous namespace)::BindingKey::(unnamed enum at clang/lib/StaticAnalyzer/Core/RegionStore.cpp)') is deprecated [-Wdeprecated-anon-enum-enum-conversion]
   XX |     : P(r, k | Symbolic), Data(reinterpret_cast<uintptr_t>(Base)) {
      |            ~ ^ ~~~~~~~~
1 warning generated.
```
---
 clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 8f18533af68b9..8e9d6fe59e6ae 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -43,10 +43,13 @@ using namespace ento;
 namespace {
 class BindingKey {
 public:
-  enum Kind { Default = 0x0, Direct = 0x1 };
-private:
-  enum { Symbolic = 0x2 };
+  enum Kind {
+    Default = 0x0,
+    Direct = 0x1,
+    Symbolic = 0x2,
+  };
 
+private:
   llvm::PointerIntPair<const MemRegion *, 2> P;
   uint64_t Data;
 



More information about the cfe-commits mailing list