https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79056
Bug ID: 79056 Summary: [C++17] ICE with broken deduction guide Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- template<typename T, typename U> struct unique_ptr { template<typename V> unique_ptr(V) { } }; template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; int main() { unique_ptr u(new int); } up.cc:8:51: error: ‘default_delete’ was not declared in this scope template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~~~~~ up.cc:8:67: error: template argument 2 is invalid template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^ up.cc:8:51: error: ‘default_delete’ was not declared in this scope template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~~~~~ up.cc:8:67: error: template argument 2 is invalid template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^ up.cc:8:51: error: ‘default_delete’ was not declared in this scope template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~~~~~ up.cc:8:67: error: template argument 2 is invalid template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^ up.cc:8:51: error: ‘default_delete’ was not declared in this scope template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^~~~~~~~~~~~~~ up.cc:8:67: error: template argument 2 is invalid template<class T> unique_ptr(T*) -> unique_ptr<T, default_delete<T>; ^ up.cc:8: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.