[clang] [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (PR #100708)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 26 00:19:46 PDT 2024
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/100708
None
>From 69670cf28f04d82adde27be86af6b8ce40e7a01c Mon Sep 17 00:00:00 2001
From: Haojian Wu <hokein.wu at gmail.com>
Date: Fri, 26 Jul 2024 09:17:50 +0200
Subject: [PATCH] [clang] Enable the -Wdangling-assignment-gsl diagnostic by
default.
---
clang/docs/ReleaseNotes.rst | 2 ++
clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 5dddd8f1c5af5..bba03f8ccccd3 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -130,6 +130,8 @@ Improvements to Clang's diagnostics
- Clang now diagnoses undefined behavior in constant expressions more consistently. This includes invalid shifts, and signed overflow in arithmetic.
+- -Wdangling-assignment-gsl is enabled by default.
+
Improvements to Clang's time-trace
----------------------------------
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 810abe4f23e31..50211a6ab5186 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -10133,7 +10133,7 @@ def warn_dangling_lifetime_pointer : Warning<
InGroup<DanglingGsl>;
def warn_dangling_lifetime_pointer_assignment : Warning<"object backing the "
"pointer %0 will be destroyed at the end of the full-expression">,
- InGroup<DanglingAssignmentGsl>, DefaultIgnore;
+ InGroup<DanglingAssignmentGsl>;
def warn_new_dangling_initializer_list : Warning<
"array backing "
"%select{initializer list subobject of the allocated object|"
More information about the cfe-commits
mailing list