https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78701
--- Comment #1 from Vincent <vince.rev at gmail dot com> --- Addition: ====================================================================== #include <iostream> template <class T, T N = T(), bool B = N> T f(T x) {return T();} int main(int argc, char* argv[]) {return f(42);} ====================================================================== (without the N + 1) returns: ====================================================================== test_bug.cpp: In substitution of ‘template<class T, T N, bool B> T f(T) [with T = int; T N = <missing>; bool B = <missing>]’: test_bug.cpp:3:46: required from here test_bug.cpp:2:40: internal compiler error: unexpected expression ‘N’ of kind template_parm_index template <class T, T N = T(), bool B = N> T f(T x) {return T();} ^ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions. ======================================================================