Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / cpp0x / decltype28.C
blobc1c5a1b305ccde4defe09998359f1ff54888a8c0
1 // PR c++/44175
2 // { dg-do compile { target c++11 } }
4 template <bool, class T> struct enable_if { };
5 template <class T> struct enable_if <true, T> { typedef T type; };
7 template <class F, int N>
8 void ft (F f, typename enable_if<N!=0, int>::type) {}
10 template< class F, int N >
11 decltype(ft<F, N-1> (F(), 0))   // { dg-error "depth" }
12 ft (F f, typename enable_if<N==0, int>::type) {}
14 int main() {
15   ft<struct a*, 2> (0, 0);      // { dg-message "from here" }