From 481eb4f5159b753497ef20cb646eb6169f3eb078 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 26 Jul 2024 19:28:37 +0200 Subject: [PATCH] [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (#100708) --- 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 286f319d41a23d..4f1a916aad9d2b 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 beee2432fdb062..e768151ce23c14 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; def warn_dangling_lifetime_pointer_assignment : Warning<"object backing the " "pointer %0 will be destroyed at the end of the full-expression">, - InGroup, DefaultIgnore; + InGroup; def warn_new_dangling_initializer_list : Warning< "array backing " "%select{initializer list subobject of the allocated object|"