xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/instantiation-order.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -verify %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc // From core issue 1227.
4f4a2713aSLionel Sambuc 
5f4a2713aSLionel Sambuc template <class T> struct A { using X = typename T::X; }; // expected-error {{no members}}
6f4a2713aSLionel Sambuc template <class T> typename T::X f(typename A<T>::X);
f(...)7f4a2713aSLionel Sambuc template <class T> void f(...) {}
8*0a6a1f1dSLionel Sambuc template <class T> auto g(typename A<T>::X) -> typename T::X; // expected-note {{here}}
g(...)9f4a2713aSLionel Sambuc template <class T> void g(...) {}
10f4a2713aSLionel Sambuc 
h()11f4a2713aSLionel Sambuc void h()
12f4a2713aSLionel Sambuc {
13f4a2713aSLionel Sambuc   f<int>(0); // ok, SFINAE in return type
14*0a6a1f1dSLionel Sambuc   g<int>(0); // not ok, substitution inside A<int> is a hard error // expected-note {{substituting}}
15f4a2713aSLionel Sambuc }
16