https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94560
Bug ID: 94560 Summary: ICE on recursive templated alias Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pacoarjonilla at yahoo dot es Target Milestone: --- Maybe related to Bug ID 93085 Only on GCC10 with --std=c++17 and --std=c++20 ICE with tuples and variants. Could not replicate with my own types. >>>>>>>>>>>>>>>>>>>>>>>>>>>>> #include <tuple> template <typename T> using B = std::tuple<T*>; using A = std::tuple<B<A>>; int main() { B b; } >>>>>>>>>>>>>>>>>>>>>>>>>>>>> Compiler output: prueba.cc:6:24: error: ‘A’ was not declared in this scope 6 | using A = std::tuple<B<A>>; | ^ prueba.cc:6:24: error: template argument 1 is invalid prueba.cc:6:25: error: template argument 1 is invalid 6 | using A = std::tuple<B<A>>; | ^~ prueba.cc:6:16: error: ‘<expression error>’ in namespace ‘std’ does not name a type 6 | using A = std::tuple<B<A>>; | ^~~~~~~~~~~ prueba.cc: In function ‘int main()’: prueba.cc:10:7: internal compiler error: in alias_ctad_tweaks, at cp/pt.c:28319 10 | B b; | ^ 0x674f3f alias_ctad_tweaks /home/paco/git/gcc/gcc/cp/pt.c:28319 0x674f3f deduction_guides_for /home/paco/git/gcc/gcc/cp/pt.c:28491 0x9f5ccb do_class_deduction /home/paco/git/gcc/gcc/cp/pt.c:28596 0x9f5ccb do_auto_deduction(tree_node*, tree_node*, tree_node*, int, auto_deduction_context, tree_node*, int) /home/paco/git/gcc/gcc/cp/pt.c:28725 0x929e5c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) /home/paco/git/gcc/gcc/cp/decl.c:7503 0x9d0f69 cp_parser_init_declarator /home/paco/git/gcc/gcc/cp/parser.c:20906 0x9b2422 cp_parser_simple_declaration /home/paco/git/gcc/gcc/cp/parser.c:13731 0x9b418a cp_parser_declaration_statement /home/paco/git/gcc/gcc/cp/parser.c:13163 0x9b4e0d cp_parser_statement /home/paco/git/gcc/gcc/cp/parser.c:11469 0x9b5d38 cp_parser_statement_seq_opt /home/paco/git/gcc/gcc/cp/parser.c:11835 0x9b5e18 cp_parser_compound_statement /home/paco/git/gcc/gcc/cp/parser.c:11785 0x9cd1b5 cp_parser_function_body /home/paco/git/gcc/gcc/cp/parser.c:23059 0x9cd1b5 cp_parser_ctor_initializer_opt_and_function_body /home/paco/git/gcc/gcc/cp/parser.c:23110 0x9d050d cp_parser_function_definition_after_declarator /home/paco/git/gcc/gcc/cp/parser.c:28958 0x9d1589 cp_parser_function_definition_from_specifiers_and_declarator /home/paco/git/gcc/gcc/cp/parser.c:28874 0x9d1589 cp_parser_init_declarator /home/paco/git/gcc/gcc/cp/parser.c:20666 0x9b2422 cp_parser_simple_declaration /home/paco/git/gcc/gcc/cp/parser.c:13731 0x9db752 cp_parser_declaration /home/paco/git/gcc/gcc/cp/parser.c:13430 0x9dbeda cp_parser_translation_unit /home/paco/git/gcc/gcc/cp/parser.c:4731 0x9dbeda c_parse_file() /home/paco/git/gcc/gcc/cp/parser.c:43829 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.