1 // PR c++/57132 2 3 template<unsigned m, unsigned a> 4 struct mod 5 { calcmod6 static unsigned calc(unsigned x) { 7 unsigned res = a * x; 8 if (m) 9 res %= m; 10 return res; 11 } 12 }; 13 main()14 int main() 15 { 16 mod<3,2>::calc(7); 17 mod<0,2>::calc(7); 18 } 19