c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / sfinae-dr1227.C
blob821ff0313b69764e3b26c003c5f9f72ad173c685
1 // PR c++/96560
2 // DR 1227
3 // Test that we substitute function parameter types in lexical order.
5 template <class T>
6 struct A { typedef typename T::type type; }; // { dg-error "void" }
8 template <class T> void f(typename T::type, typename A<T>::type);
9 template <class T> long f(...);
11 long x = f<int>(0, 0); // { dg-bogus "" } OK
14 template <class T> void g(T, typename A<T>::type);
15 template <class T> long g(...);
17 long y = g<void>(0, 0); // { dg-bogus "" } OK
20 template <class T> void h(typename A<T>::type, T);
21 template <class T> long h(...);
23 long z = h<void>(0, 0); // { dg-message "required from here" } hard error