https://github.com/sipher-01 created 
https://github.com/llvm/llvm-project/pull/204891

Fixes #204213

`-Wlifetime-safety-dangling-global-moved` was defined but not included
in any parent diagnostic group, meaning `-Wlifetime-safety-all` and
`-Wno-lifetime-safety-all` had no effect on it.

`LifetimeSafetyDanglingGlobal` (the non-moved variant) was already
correctly placed under `LifetimeSafetyPermissive`. Following the same
pattern as the other `-moved` sibling warnings
(`DanglingFieldMoved`, `ReturnStackAddrMoved`, `UseAfterScopeMoved`),
this patch adds `LifetimeSafetyDanglingGlobalMoved` to
`LifetimeSafetyStrict`, which is part of the `lifetime-safety-all`
hierarchy.

>From 3307e7c247e3b0cc64b8cdc9b59349bd2133c680 Mon Sep 17 00:00:00 2001
From: Sipher <[email protected]>
Date: Sat, 20 Jun 2026 02:06:18 +0530
Subject: [PATCH] [Clang][LifetimeSafety] Add DanglingGlobalMoved to
 lifetime-safety-strict group

lifetime-safety-dangling-global-moved was defined but not included in
any parent diagnostic group, meaning -Wlifetime-safety-all and
-Wno-lifetime-safety-all had no effect on it. Add it to
LifetimeSafetyStrict alongside its sibling -moved warnings.

Fixes #204213
---
 clang/include/clang/Basic/DiagnosticGroups.td | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/include/clang/Basic/DiagnosticGroups.td 
b/clang/include/clang/Basic/DiagnosticGroups.td
index 244cd3630bb11..5cdebd35ba05d 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -663,6 +663,7 @@ def LifetimeSafetyStrict : 
DiagGroup<"lifetime-safety-strict",
                                     LifetimeSafetyUseAfterScopeMoved,
                                     LifetimeSafetyReturnStackAddrMoved,
                                     LifetimeSafetyDanglingFieldMoved,
+                                    LifetimeSafetyDanglingGlobalMoved,
                                     LifetimeSafetyInvalidation]>;
 
 def LifetimeSafety : DiagGroup<"lifetime-safety",

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to