2 // { dg-do compile { target c++14 } }
4 template <class T> T&& declval() noexcept;
5 template <class, class>
6 constexpr bool is_same = false;
8 constexpr bool is_same<T, T> = true;
11 struct indirected : F {
12 indirected(F f) : F(f) {}
14 auto operator()(I i) -> decltype(declval<F&>()(*i)) {
15 return static_cast<F&>(*this)(*i);
20 auto f = [](auto rng) {
21 static_assert(is_same<decltype(rng), int>, "");
24 indirected<decltype(f)> i(f);
25 static_assert(is_same<decltype(i(declval<int*>())), int>, "");