[clang] [LifetimeSafety] Fix compiler crash with `static operator()` (PR #187853)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 23 03:23:28 PDT 2026
================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++23 -Wlifetime-safety -Wno-dangling -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++23 -flifetime-safety-inference -fexperimental-lifetime-safety-tu-analysis -Wlifetime-safety -Wno-dangling -verify %s
----------------
hokein wrote:
I'd add the new tests to the existing `clang/test/Sema/warn-lifetime-safety.cpp` case.
The test requires c++23, we could just use the following `#pragma` to disable the c++23-extension warning.
```
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++23-extensions"
...
```
https://github.com/llvm/llvm-project/pull/187853
More information about the cfe-commits
mailing list