aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype28.C
blob: c1c5a1b305ccde4defe09998359f1ff54888a8c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/44175
// { dg-do compile { target c++11 } }

template <bool, class T> struct enable_if { };
template <class T> struct enable_if <true, T> { typedef T type; };

template <class F, int N>
void ft (F f, typename enable_if<N!=0, int>::type) {}

template< class F, int N >
decltype(ft<F, N-1> (F(), 0))	// { dg-error "depth" }
ft (F f, typename enable_if<N==0, int>::type) {}

int main() {
  ft<struct a*, 2> (0, 0);	// { dg-message "from here" }
}