https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118265

            Bug ID: 118265
           Summary: Failure in resolving non-type template parameters with
                    nested parameter pack of form
                    <typename...A,Class<A>...B>
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc.gnu.org at ajryansolutions dot co.uk
  Target Milestone: ---

I originally reported the problem in Bug 78216
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78216) and having investigated it
further found it is a separate problem that the following example better
demonstrates.


template<class> struct Class1{};

template<auto...Tn> class Class2;
template<typename...V,Class1<V>...Un> class Class2<Un...>
{
    public: void apply(){}
};

Class1<bool> class1_bool;
Class1<char> class1_char;

int main()
{
    Class2<class1_bool,class1_char> class2;
    class2.apply();
}


When the compiler is resolving Un it fails to explore V for the associated
parameter pack V and leads to an unknown placeholder in the the template when
creating the instance class2, this then leads to it's first and fatal failure
when it tries to get the assembly name for it:

<source>:15:1: internal compiler error: Segmentation fault
   15 | }
      | ^
0x28b0815 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x28c7515 internal_error(char const*, ...)
        ???:0
0xeb2898 symbol_table::decl_assembler_name_hash(tree_node const*)
        ???:0
0xeb6b14 symtab_node::get_for_asmname(tree_node const*)
        ???:0
0xeb6c31 symtab_node::verify_base()
        ???:0
0xec7e2d cgraph_node::verify_node()
        ???:0
0xeb77c4 symtab_node::verify()
        ???:0
0xeb89a7 symtab_node::verify_symtab_nodes()
        ???:0
0xed172b symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

Reply via email to