https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79056
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- A slightly different example: template<typename T, typename U> struct unique_ptr { template<typename V> unique_ptr(V) { } }; template<typename T> struct default_delete { }; template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; int main() { unique_ptr u(new int); } With a similar ICE after different errors: ice.cc:10:51: error: template argument 2 is invalid template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~~~~~~~~ ice.cc:10:51: error: template argument 2 is invalid ice.cc:10:51: error: template argument 2 is invalid ice.cc:10:51: error: template argument 2 is invalid ice.cc:10:37: internal compiler error: Segmentation fault template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~ 0xdb8b9f crash_signal /home/jwakely/src/gcc/gcc/gcc/toplev.c:333 0x78fe4b cp_parser_check_for_invalid_template_id /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:2989 0x77e57e cp_parser_check_for_invalid_template_id /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:2987 0x77e57e cp_parser_simple_type_specifier /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:16942 0x77bdfd cp_parser_type_specifier /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:16496 0x77cda2 cp_parser_type_specifier_seq /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:20763 0x787931 cp_parser_type_id_1 /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:20606 0x7871c6 cp_parser_trailing_type_id /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:20697 0x7871c6 cp_parser_late_return_type_opt /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:20518 0x7871c6 cp_parser_direct_declarator /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:19707 0x7871c6 cp_parser_declarator /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:19527 0x79a189 cp_parser_init_declarator /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:19061 0x7a2ce7 cp_parser_single_declaration /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:26673 0x7a2e0c cp_parser_template_declaration_after_parameters /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:26277 0x7a3842 cp_parser_explicit_template_declaration /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:26513 0x7a3842 cp_parser_template_declaration_after_export /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:26531 0x7a3e49 cp_parser_declaration /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:12438 0x7a4166 cp_parser_declaration_seq_opt /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:12365 0x7a4498 cp_parser_translation_unit /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:4369 0x7a4498 c_parse_file() /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:38366 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.