[clang] [LifetimeSafety] Handle xvalue operand of LValueToRValue cast (PR #192312)

Zhijie Wang via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 09:19:41 PDT 2026


================
@@ -1,6 +1,7 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
 // RUN: %clang_cc1 -fsyntax-only -flifetime-safety-inference -fexperimental-lifetime-safety-tu-analysis -Wlifetime-safety-suggestions -Wlifetime-safety -Wno-dangling -I%t -I%S -verify %t/test_source.cpp
+// RUN: %clang_cc1 -fsyntax-only -std=c++23 -flifetime-safety-inference -fexperimental-lifetime-safety-tu-analysis -Wlifetime-safety-suggestions -Wlifetime-safety -Wno-dangling -I%t -I%S -verify %t/test_source.cpp
----------------
aeft wrote:

We already have these tests, including `return_pointer_directly`, `return_ptr_to_ref`, `template_identity`, `test_template_inference_with_stack`. These tests failed before this patch under C++23.

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


More information about the cfe-commits mailing list