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

            Bug ID: 102931
           Summary: ICE explicit lambda call operator without template
                    keyword
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/8GGoqr9z3.

```C++
template<class T> void f() {
  []<class>() {

  }.operator()<T>();
}
int main() {
  f<int>();
}
```

```
<source>: In instantiation of 'void f() [with T = int]':
<source>:7:9:   required from here
<source>:4:17: internal compiler error: in lookup_template_class_1, at
cp/pt.c:10017
    2 |   []<class>() {
      |   ~~~~~~~~~~~~~  
    3 | 
      |                  
    4 |   }.operator()<T>();
      |   ~~~~~~~~~~~~~~^
0x1ffe519 internal_error(char const*, ...)
        ???:0
0x7d6f1b fancy_abort(char const*, int, char const*)
        ???:0
0xa54df1 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ???:0
0xa4005d tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xa45fc7 instantiate_decl(tree_node*, bool, bool)
        ???:0
0xa88b1b instantiate_pending_templates(int)
        ???:0
0x8edf99 c_parse_final_cleanups()
        ???:0
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.
Compiler returned: 1
```

Reply via email to