| 1 |
// Verify we preserve the consistency of member function lookup outside of a |
| 2 |
// complete-class context. |
| 3 |
// { dg-do compile { target c++11 } } |
| 4 |
|
| 5 |
template<class...> |
| 6 |
struct A { |
| 7 |
template<class T> static void f(); // #1 |
| 8 |
template<class T> static auto g() -> decltype(f<T>()); |
| 9 |
template<class T> static void f(...); // #2 |
| 10 |
}; |
| 11 |
|
| 12 |
int main() { |
| 13 |
A<>::g<int>(); // OK, the later-declared #2 isn't considered when |
| 14 |
// instantiating f<T>(), which would have otherwise |
| 15 |
// led to ambiguity. |
| 16 |
} |