[Bug c++/77369] incorrect noexcept specification deduction
mail@daniel-boehmer.net
gcc-bugzilla@gcc.gnu.org
Wed Feb 15 12:40:00 GMT 2017
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;
}
More information about the Gcc-bugs
mailing list