[clang] [LifetimeSafety] Allow configuring lifetimebound fix-it spelling (PR #204045)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 16 08:55:05 PDT 2026


================
@@ -30,6 +35,8 @@ struct [[gsl::Pointer()]] View {
 View return_view(View a) {
   // CHECK: :[[@LINE-1]]:18: warning: parameter in intra-TU function should be marked {{\[\[}}clang::lifetimebound]] [-Wlifetime-safety-intra-tu-suggestions]
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:24-[[@LINE-2]]:24}:" {{\[\[}}clang::lifetimebound]]"
+  // CHECK-MACRO: :[[@LINE-3]]:18: warning: parameter in intra-TU function should be marked
+  // CHECK-MACRO: fix-it:"{{.*}}":{[[@LINE-4]]:24-[[@LINE-4]]:24}:" LIFETIMEBOUND_MACRO"
----------------
NeKon69 wrote:

Maybe you should actually define the macro above? Because if you were to apply these suggestions, the code would fail to compile.

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


More information about the cfe-commits mailing list