[Bug c++/79400] New: [7 Regression] Confusing 'noexcept' suggestion on throw (X)

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 7 07:56:00 GMT 2017


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

            Bug ID: 79400
           Summary: [7 Regression] Confusing 'noexcept' suggestion on
                    throw (X)
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

struct Bar {};
struct Foo
{
  Foo(int) throw(Bar);
};

results in

> ./cc1plus  -quiet t.C
t.C:4:12: warning: dynamic exception specifications are deprecated in C++11;
use 'noexcept' instead [-Wdeprecated]
   Foo(int) throw(Bar);
            ^~~~~

shouldn't it suggest to omit the deprecated exception specification instead? 
Using 'noexcept' in this context would be clearly wrong.


More information about the Gcc-bugs mailing list