// PR c++/71117 // { dg-do compile { target c++14 } } template T&& declval() noexcept; template constexpr bool is_same = false; template constexpr bool is_same = true; template struct indirected : F { indirected(F f) : F(f) {} template auto operator()(I i) -> decltype(declval()(*i)) { return static_cast(*this)(*i); } }; int main() { auto f = [](auto rng) { static_assert(is_same, ""); return 42; }; indirected i(f); static_assert(is_same())), int>, ""); }