prog.cpp: In instantiation of 'size_t test(const char (&)[N], int) [with unsigned int N = 3u; size_t = unsigned int]':
prog.cpp:19:22: required from here
prog.cpp:15:68: error: no matching function for call to 'calc(int&)'
size_t test(const char (&ch)[N], int add) { return calc<sum<N>(ch)>(add); }
^
prog.cpp:12:8: note: candidate: template<unsigned int N> size_t calc(size_t)
size_t calc(size_t add) { return N + add; }
^
prog.cpp:12:8: note: template argument deduction/substitution failed:
prog.cpp:15:63: in constexpr expansion of 'sum<3u>((* & ch))'
prog.cpp:15:68: error: 'ch' is not a constant expression
size_t test(const char (&ch)[N], int add) { return calc<sum<N>(ch)>(add); }
^
prog.cpp:15:68: note: in template argument for type 'unsigned int'