| 1 |
// PR c++/80767 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-additional-options "-Wno-return-type" } |
| 4 |
|
| 5 |
template <typename T, typename U = T> struct A { using type = U; }; |
| 6 |
template <typename F, typename... G> struct B : B<F>::type, B<G...>::type { |
| 7 |
using type = B; |
| 8 |
using B<F>::type::operator(); |
| 9 |
}; |
| 10 |
template <typename F> struct B<F> { using type = F; }; |
| 11 |
struct { |
| 12 |
template <typename... F, |
| 13 |
typename Overload = typename B<typename A<F>::type...>::type> |
| 14 |
Overload operator()(F...){} |
| 15 |
} a; |
| 16 |
int main() { |
| 17 |
auto f = a([](int) {}, [](float) {}); |
| 18 |
f({}); |
| 19 |
} |