This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/77369] incorrect noexcept specification deduction


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

Daniel Böhmer <mail@daniel-boehmer.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mail@daniel-boehmer.net

--- Comment #2 from Daniel Böhmer <mail@daniel-boehmer.net> ---
I can confirm this issue for GCC 6.2.0 and std=c++17


Considering the following example, this issue is problematic, where
std::terminate is called for func2(), instead of passing the exception to the
caller.


template<typename F> void caller(F&& f)
{
   std::forward<F>(f)();
}

void func1() noexcept
{
}

void func2()
{
   throw std::exception();
}

int main()
{
   caller(func1);

   try
   {
      caller(func2);
   }
   catch(...)
   {
   }   
   return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]