Skip to content

Commit 09122fe

Browse files
dougsonosDoug Wyatt
andauthored
Clang: Remove -Wperf-constraint-implies-noexcept from -Wall. (llvm#167540)
In adopting `[[clang::nonblocking]]` there's been some user confusion. Changes to address `-Wfunction-effects` warnings are often pure annotation, with no runtime effect. Changes to avoid `-Wperf-constraint-implies-noexcept` warnings are risky: adding `noexcept` creates a new potential for the program to crash. In retrospect, `-Wperf-constraint-implies-noexcept` shouldn't have been made part of `-Wall`. --------- Co-authored-by: Doug Wyatt <[email protected]>
1 parent 6b49e6a commit 09122fe

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ Improvements to Clang's diagnostics
359359
Moved the warning for a missing (though implied) attribute on a redeclaration into this group.
360360
Added a new warning in this group for the case where the attribute is missing/implicit on
361361
an override of a virtual method.
362+
- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat nit-picky and
363+
attempts to resolve it, by adding ``noexcept``, can create new ways for programs to crash. (#GH167540)
362364
- Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size`
363365
produces an invalid size (either negative or greater than the implementation limit). (#GH159563)
364366
- Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ def Consumed : DiagGroup<"consumed">;
13141314
// DefaultIgnore in addition to putting it here.
13151315
def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool,
13161316
MisleadingIndentation, PackedNonPod,
1317-
VLACxxExtension, PerfConstraintImpliesNoexcept]>;
1317+
VLACxxExtension]>;
13181318

13191319
// Warnings that should be in clang-cl /w4.
13201320
def : DiagGroup<"CL4", [All, Extra]>;

clang/test/Misc/warning-wall.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,5 @@ CHECK-NEXT: -Wmisleading-indentation
109109
CHECK-NEXT: -Wpacked-non-pod
110110
CHECK-NEXT: -Wvla-cxx-extension
111111
CHECK-NEXT: -Wvla-extension-static-assert
112-
CHECK-NEXT: -Wperf-constraint-implies-noexcept
113112

114113
CHECK-NOT:-W

0 commit comments

Comments
 (0)