2 // { dg-do compile { target c++11 } }
4 constexpr __SIZE_TYPE__ fibonacci(__SIZE_TYPE__ val) {
5 return (val <= 2) ? 1 : fibonacci(val - 1) + fibonacci(val - 2);
8 template <typename Function>
10 constexpr Defer(const Function func_) : func(func_) { }
14 template <typename... Args>
15 constexpr auto operator () (const Args&... args) -> decltype(func(args...)) {
20 template <typename Function>
21 constexpr Defer<Function> make_deferred(const Function f) {
22 return Defer<Function>(f);
26 constexpr auto deferred = make_deferred(&fibonacci);
27 static_assert(deferred(25) == 75025, "Static fibonacci call failed"); // { dg-error "no match for call" "" { target c++14 } }