// PR c++/72845 // { dg-do compile { target c++11 } } template struct g { static const int h = 0; }; template void declval() { static_assert(!g::h,""); } template struct a { template friend auto f(d &&, c &&) noexcept(declval) -> decltype(declval); // { dg-error "different exception" } }; template auto f(d &&, c &&) -> decltype(declval); struct e {}; static_assert((e{}, declval>),"");