Issue 164615
Summary `template` required when explicitly specifying template arguments for a generic lambda in a template
Labels new issue
Assignees
Reporter ckwastra
    Test code ([CE](https://godbolt.org/z/7r76s9h55)):

```cpp
template <int> void f() {
  // - EDG: OK
  // - GCC/Clang/MSVC: error
  []<int> {}.operator()<0>();
}
```

According to [[temp.dep.type]/10](https://eel.is/c++draft/temp.dep.type#10), the closure type above is not dependent. Even if it happens to be dependent, [[temp.dep.type]/1.5](https://eel.is/c++draft/temp.dep.type#1.5) (added by [CWG2936](https://cplusplus.github.io/CWG/issues/2936.html)) specifies that a local class in a templated function is part of the current instantiation (though I'm not sure whether this applies to closure types):

> - in the definition of a templated function, the name of a local class ([class.local]).

So, I don't think the `template` disambiguator should be required here, as it only adds syntactic noise.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to