1// PR c++/45012 2 3template <bool B, class T=void> struct enable_if; 4 5template <class T> 6struct enable_if<true,T> 7{ 8 typedef T type; 9}; 10 11enum { RUNTIME = 0 }; 12// it compiles with the previous line commented out and the next commented in 13// static const int RUNTIME=0; 14 15template <class T, class U, class EN=void> struct foo; 16 17template <template<int> class V, int M> 18struct foo<V<M>,V<M>, typename enable_if<M==RUNTIME||M==2>::type> {}; 19 20template <template<int> class V1, template<int> class V2, int M> 21struct foo<V1<M>,V2<M>, typename enable_if<M==RUNTIME||M==2>::type> {}; 22 23template <int M> struct bar {}; 24 25foo<bar<2>,bar<2> > x; 26