https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87956

            Bug ID: 87956
           Summary: Gcc should emit deprecation warnings when using
                    throw() in C++ >= 17
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: romain.geissler at amadeus dot com
  Target Milestone: ---

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

Reply via email to