[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127702)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 08:43:22 PST 2025


================
@@ -0,0 +1,30 @@
+// RUN: %clang_analyze_cc1 -verify %s\
+// RUN:   -analyzer-checker=core,debug.ExprInspection
+
+void clang_analyzer_eval(bool);
+
+using size_t = decltype(sizeof(int));
+
+template <class FirstT, class... Rest>
+void escape(FirstT first, Rest... args);
+
+namespace CustomClassType {
+struct S {
+  int x;
+  static void* operator new(size_t size) {
+    return ::operator new(size);
+  }
+};
+void F() {
+  S *s = new S;
+  clang_analyzer_eval(s->x); // expected-warning{{UNKNOWN}} FIXME: should be an undefined warning
----------------
steakhal wrote:

Ah, yes. You are right. All good.

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


More information about the cfe-commits mailing list