From 12dc263c4c95d223cc4ee41196f1715b747438c1 Mon Sep 17 00:00:00 2001 From: Doug Wyatt Date: Tue, 11 Nov 2025 08:58:28 -0800 Subject: [PATCH 1/3] Clang: Remove `-Wperf-constraint-implies-noexcept` from `-Wall`. --- clang/docs/ReleaseNotes.rst | 3 ++- clang/include/clang/Basic/DiagnosticGroups.td | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 980dbf1ff2cf6..fcad4c0fb7133 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -350,6 +350,8 @@ Improvements to Clang's diagnostics Moved the warning for a missing (though implied) attribute on a redeclaration into this group. Added a new warning in this group for the case where the attribute is missing/implicit on an override of a virtual method. +- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110) +- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. - Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size` produces an invalid size (either negative or greater than the implementation limit). (#GH159563) - Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right @@ -482,7 +484,6 @@ Bug Fixes to Attribute Support - Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075) - Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905) - Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function. -- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110) Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 1e0321de3f4b6..8ec9f47c51fda 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1312,9 +1312,9 @@ def Consumed : DiagGroup<"consumed">; // Note that putting warnings in -Wall will not disable them by default. If a // warning should be active _only_ when -Wall is passed in, mark it as // DefaultIgnore in addition to putting it here. -def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, - MisleadingIndentation, PackedNonPod, - VLACxxExtension, PerfConstraintImpliesNoexcept]>; +def All + : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, + MisleadingIndentation, PackedNonPod, VLACxxExtension]>; // Warnings that should be in clang-cl /w4. def : DiagGroup<"CL4", [All, Extra]>; From 0212ff5bbf9bae04efc456d4c1c40f3fb4351a7f Mon Sep 17 00:00:00 2001 From: Doug Wyatt Date: Tue, 11 Nov 2025 13:12:56 -0800 Subject: [PATCH 2/3] Revert formatting change and release note move. Fix test broken by this change. --- clang/docs/ReleaseNotes.rst | 5 +++-- clang/include/clang/Basic/DiagnosticGroups.td | 6 +++--- clang/test/Misc/warning-wall.c | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index fcad4c0fb7133..f916e298c2ed4 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -350,8 +350,8 @@ Improvements to Clang's diagnostics Moved the warning for a missing (though implied) attribute on a redeclaration into this group. Added a new warning in this group for the case where the attribute is missing/implicit on an override of a virtual method. -- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110) -- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. +- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat pedantic and + attempts to resolve it, by adding ``noexcept``, can create new ways for programs to crash. (#GH167540) - Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size` produces an invalid size (either negative or greater than the implementation limit). (#GH159563) - Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right @@ -484,6 +484,7 @@ Bug Fixes to Attribute Support - Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075) - Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905) - Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function. +- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110) Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 8ec9f47c51fda..2fff32bbc4d6c 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1312,9 +1312,9 @@ def Consumed : DiagGroup<"consumed">; // Note that putting warnings in -Wall will not disable them by default. If a // warning should be active _only_ when -Wall is passed in, mark it as // DefaultIgnore in addition to putting it here. -def All - : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, - MisleadingIndentation, PackedNonPod, VLACxxExtension]>; +def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, + MisleadingIndentation, PackedNonPod, + VLACxxExtension]>; // Warnings that should be in clang-cl /w4. def : DiagGroup<"CL4", [All, Extra]>; diff --git a/clang/test/Misc/warning-wall.c b/clang/test/Misc/warning-wall.c index 689868c62f6a7..83b8d4d1f2c29 100644 --- a/clang/test/Misc/warning-wall.c +++ b/clang/test/Misc/warning-wall.c @@ -109,6 +109,5 @@ CHECK-NEXT: -Wmisleading-indentation CHECK-NEXT: -Wpacked-non-pod CHECK-NEXT: -Wvla-cxx-extension CHECK-NEXT: -Wvla-extension-static-assert -CHECK-NEXT: -Wperf-constraint-implies-noexcept CHECK-NOT:-W From 9190685daf9d9e6f25b36b0fe930418595c42077 Mon Sep 17 00:00:00 2001 From: Doug Wyatt Date: Thu, 13 Nov 2025 07:58:02 -0800 Subject: [PATCH 3/3] pedantic -> nit-picky --- clang/docs/ReleaseNotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index f916e298c2ed4..0271ae13b8a69 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -350,7 +350,7 @@ Improvements to Clang's diagnostics Moved the warning for a missing (though implied) attribute on a redeclaration into this group. Added a new warning in this group for the case where the attribute is missing/implicit on an override of a virtual method. -- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat pedantic and +- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat nit-picky and attempts to resolve it, by adding ``noexcept``, can create new ways for programs to crash. (#GH167540) - Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size` produces an invalid size (either negative or greater than the implementation limit). (#GH159563)