https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
--- Comment #2 from janus at gcc dot gnu.org --- Further reduced test case: template <int i> constexpr int find_longest_name() { return sizeof("Main") - 1; } template <int i, int l = find_longest_name<i>()> void create_all_loggers() {} int main() { create_all_loggers<1>(); } $ g++-5.0 logging.cc -std=c++11 logging.cc: In function ‘int main()’: logging.cc:11:25: error: no matching function for call to ‘create_all_loggers()’ create_all_loggers<1>(); ^ logging.cc:6:55: note: candidate: template<int i, int l> void create_all_loggers() template <int i, int l = find_longest_name<i>()> void create_all_loggers() ^ logging.cc:6:55: note: template argument deduction/substitution failed: logging.cc:6: confused by earlier errors, bailing out