[clang] [analyzer] Add support for consteval in ConditionBRVisitor::VisitTerminator (PR #146859)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 3 06:20:41 PDT 2025
================
@@ -0,0 +1,8 @@
+// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s
+
+void test_consteval() {
+ if consteval {
+ int *ptr = nullptr;
+ *ptr = 42; // expected-warning{{Dereference of null pointer (loaded from variable 'ptr')}}
+ }
+}
----------------
steakhal wrote:
```suggestion
}
```
https://github.com/llvm/llvm-project/pull/146859
More information about the cfe-commits
mailing list