[Bug c++/4898] adding an option to verify exception specifications [-Wexceptions]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4898 Eric Gallager changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=97675 CC||egallager at gcc dot gnu.org, ||mpolacek at gcc dot gnu.org --- Comment #11 from Eric Gallager --- Marek added a new -Wexceptions option for bug 97675 here: https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558173.html (it's for something else, though)
[Bug c++/4898] adding an option to verify exception specifications [-Wexceptions]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4898 --- Comment #10 from Eric Gallager --- (In reply to Jonathan Wakely from comment #9) > Why a new warning instead of making -Wterminate handle throw() as well as > noexcept ? For consistency with clang? I dunno, I guess putting it under -Wterminate could work too...
[Bug c++/4898] adding an option to verify exception specifications [-Wexceptions]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4898 --- Comment #9 from Jonathan Wakely --- Why a new warning instead of making -Wterminate handle throw() as well as noexcept ?
[Bug c++/4898] adding an option to verify exception specifications [-Wexceptions]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4898 Eric Gallager changed: What|Removed |Added Blocks||87403 Summary|adding an option to verify |adding an option to verify |exception specifications|exception specifications ||[-Wexceptions] --- Comment #8 from Eric Gallager --- (In reply to Jonathan Wakely from comment #7) > (In reply to Martin Sebor from comment #2) > > I agree a new warning would be useful. For example, the following code > > should > > be diagnosed: > > > > struct S { S () throw () { throw 0; } }; > > This is still relevant in current standards, where throw() is equivalent to > noexcept. > > Clang warns: > > throw.cc:1:28: warning: 'S' has a non-throwing exception specification but > can still throw [-Wexceptions] > struct S { S () throw () { throw 0; } }; >^ > throw.cc:1:12: note: function declared non-throwing here > struct S { S () throw () { throw 0; } }; >^ > 1 warning generated. > Having a -Wexceptions like clang's would be a useful new warning; thus, making this block the new-warning meta-bug Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87403 [Bug 87403] [Meta-bug] Issues that suggest a new warning