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

            Bug ID: 108066
           Summary: ICE in use_pack_expansion_extra_args_p, at
                    cp/pt.cc:12661
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danakj at orodu dot net
  Target Milestone: ---

```
template <class... T>
struct Foo;

template <class A, class B>
concept C = true;

template <class... T>
struct Foo {
    template <class... U>
        requires ((... && C<T, U>))
    friend void bar(Foo, Foo<U...>) {}
};

int main() {
    Foo<int> x;
    bar(x, Foo<int>());
}
```

godbolt: https://godbolt.org/z/KozobKa1q

<source>: In instantiation of 'struct Foo<int>':
<source>:15:14:   required from here
<source>:10:27: internal compiler error: in use_pack_expansion_extra_args_p, at
cp/pt.cc:12661
   10 |         requires ((... && C<T, U>))
      |                  ~~~~~~~~~^~~~~~~~~
0x22efc1e internal_error(char const*, ...)
        ???:0
0xa4af9a fancy_abort(char const*, int, char const*)
        ???:0
0xabf850 tsubst_constraint(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xabf939 maybe_substitute_reqs_for(tree_node*, tree_node const*)
        ???:0
0xc7c12c instantiate_class_template(tree_node*)
        ???:0
0xafe1a3 start_decl_1(tree_node*, bool)
        ???:0
0xb1ffb7 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ???:0
0xc242c7 c_parse_file()
        ???:0
0xd5e809 c_common_parse_file()
        ???: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.
ASM generation compiler returned: 1
<source>: In instantiation of 'struct Foo<int>':
<source>:15:14:   required from here
<source>:10:27: internal compiler error: in use_pack_expansion_extra_args_p, at
cp/pt.cc:12661
   10 |         requires ((... && C<T, U>))
      |                  ~~~~~~~~~^~~~~~~~~
0x22efc1e internal_error(char const*, ...)
        ???:0
0xa4af9a fancy_abort(char const*, int, char const*)
        ???:0
0xabf850 tsubst_constraint(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xabf939 maybe_substitute_reqs_for(tree_node*, tree_node const*)
        ???:0
0xc7c12c instantiate_class_template(tree_node*)
        ???:0
0xafe1a3 start_decl_1(tree_node*, bool)
        ???:0
0xb1ffb7 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ???:0
0xc242c7 c_parse_file()
        ???:0
0xd5e809 c_common_parse_file()
        ???: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.
Execution build compiler returned: 1

Reply via email to