[clang] 481eb4f - [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (#100708)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 10:28:41 PDT 2024


Author: Haojian Wu
Date: 2024-07-26T19:28:37+02:00
New Revision: 481eb4f5159b753497ef20cb646eb6169f3eb078

URL: https://github.com/llvm/llvm-project/commit/481eb4f5159b753497ef20cb646eb6169f3eb078
DIFF: https://github.com/llvm/llvm-project/commit/481eb4f5159b753497ef20cb646eb6169f3eb078.diff

LOG: [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (#100708)

Added: 
    

Modified: 
    clang/docs/ReleaseNotes.rst
    clang/include/clang/Basic/DiagnosticSemaKinds.td

Removed: 
    


################################################################################
diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 286f319d41a23..4f1a916aad9d2 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -133,6 +133,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 beee2432fdb06..e768151ce23c1 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -10131,7 +10131,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