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

            Bug ID: 118391
           Summary: ICE: in add_extra_args, at cp/pt.cc:13737
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/TovxM83E6
This seems to work with GCC 14.2


```
template<typename>
using A = int;

template<typename T>
using B = decltype([]<typename> {}.template operator()<T>());

template<typename T>
using C = A<B<T>>;

C<int> x;

int main() {}
```



<source>: In substitution of 'template<class T> using C = A<decltype
(<lambda>.operator()<T>())> [with T = int]':
<source>:10:6:   required from here
   10 | C<int> x;
      |      ^
<source>:5:20: internal compiler error: in add_extra_args, at cp/pt.cc:13737
    5 | using B = decltype([]<typename> {}.template operator()<T>());
      |                    ^~~~~~~~~~~~~~~
0x28fe3b5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x29151b6 internal_error(char const*, ...)
        ???:0
0xacb842 fancy_abort(char const*, int, char const*)
        ???:0
0xd17f0d tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd26557 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd31fa4 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd2616a tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd3a533 instantiate_template(tree_node*, tree_node*, int)
        ???:0
0xd23fca lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
        ???:0
0xd6525c finish_template_type(tree_node*, tree_node*, int)
        ???:0
0xce5eba c_parse_file()
        ???:0
0xe45879 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.
Compiler returned: 1

Reply via email to