Bug 87956 - Gcc should emit deprecation warnings when using throw() in C++ >= 17
Summary: Gcc should emit deprecation warnings when using throw() in C++ >= 17
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2018-11-09 10:26 UTC by Romain Geissler
Modified: 2024-03-08 03:21 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-02-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Geissler 2018-11-09 10:26:32 UTC
Hi,

Today gcc always generates an error when you use a dynamic exception specification with some exception. However I would expect we might also get a warning with -Wdeprecated for "throw()" expressions.

With -std=gnu++17 -Wdeprecated

#include <stdexcept>

void f() throw(); // No deprecation warning saying you should use noexcept instead
void g() throw(std::exception); // Errors in C++17

I would expect a deprecation warning for f.

FYI, clang's -Wdeprecated flag finds and notifies about this.

Cheers,
Romain
Comment 1 Andrew Pinski 2021-07-24 17:54:07 UTC
Confirmed.