Skip to content

Conversation

@steakhal
Copy link
Contributor

@steakhal steakhal commented Sep 9, 2025

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: 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.
```
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Sep 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 9, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Balazs Benics (steakhal)

Changes
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&lt;uintptr_t&gt;(Base)) {
      |            ~ ^ ~~~~~~~~
1 warning generated.

Full diff: https://github.com/llvm/llvm-project/pull/157630.diff

1 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Core/RegionStore.cpp (+6-3)
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;
 

@steakhal steakhal closed this Sep 9, 2025
@steakhal steakhal deleted the bb/fix-warning branch September 9, 2025 12:10
@NagyDonat
Copy link
Contributor

@steakhal Why did you discard this patch? It looks good to me at first glance.

@steakhal steakhal restored the bb/fix-warning branch September 9, 2025 12:39
@steakhal
Copy link
Contributor Author

steakhal commented Sep 9, 2025

@steakhal Why did you discard this patch? It looks good to me at first glance.

Ah, accidentally :D I thought I already merged it. And in the branches section of your fork it doesn't say anything if you try to delete a branch that has an open PR. nvm.

Reopening it. @NagyDonat have look :)

@steakhal steakhal reopened this Sep 9, 2025
@steakhal steakhal merged commit 090a81f into llvm:main Sep 9, 2025
19 checks passed
@steakhal steakhal deleted the bb/fix-warning branch September 9, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants