// This test verifies that after resolving a non-dependent call expression // ahead of time, we prune all but the selected candidate from the overload // set. Without this optimization, overload resolution for the final call to // f() would be exponential in the size of the overload set. // { dg-do compile { target c++11 } } template void f(); template auto f() -> decltype(f(), 1, *T()); template auto f() -> decltype(f(), 2, *T()); template auto f() -> decltype(f(), 3, *T()); template auto f() -> decltype(f(), 4, *T()); template auto f() -> decltype(f(), 5, *T()); template auto f() -> decltype(f(), 6, *T()); template auto f() -> decltype(f(), 7, *T()); template auto f() -> decltype(f(), 8, *T()); template auto f() -> decltype(f(), 9, *T()); template auto f() -> decltype(f(), 10, *T()); template auto f() -> decltype(f(), 11, *T()); template auto f() -> decltype(f(), 12, *T()); template auto f() -> decltype(f(), 13, *T()); template auto f() -> decltype(f(), 14, *T()); template auto f() -> decltype(f(), 15, *T()); template auto f() -> decltype(f(), 16, *T()); template auto f() -> decltype(f(), 17, *T()); template auto f() -> decltype(f(), 18, *T()); template auto f() -> decltype(f(), 19, *T()); template auto f() -> decltype(f(), 20, *T()); template auto f() -> decltype(f(), 21, *T()); template auto f() -> decltype(f(), 22, *T()); template auto f() -> decltype(f(), 23, *T()); template auto f() -> decltype(f(), 24, *T()); template auto f() -> decltype(f(), 25, *T()); int main() { f(); }