template<bool b = 2> void foo(void) {} template void foo(); template<unsigned char n = 258> void bar(void) {} template void bar();
GCC creates an instance of foo <true> and bar <2>; Klang rejects both arguments "error: non-type template" equal to 2, which cannot be narrowed to type "bool" [-WC ++ 11-narrowing] ".
Is the code above valid? Is this a mistake in one of them?
Used versions: Clang 3.8.0-2ubuntu4, GCC 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1 ~ 16.04.2)
source share