| Issue |
160833
|
| Summary |
non-rejected referring a closure member in a friend declaration
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
ingmaurorusso
|
from C++ standards (since C++14 up to at least C++23):
_A member of a closure type shall not be explicitly instantiated (x.y.z), explicitly specialized (x.y.z), **or named in a friend declaration** (x.y.z)._
But the following code is accepted by clang 21.1.0 ([godbolt test](https://godbolt.org/z/jrWonvveh)):
```
auto f = []{};
#if __cplusplus >= 201703L
#define CE_17 constexpr
#else
#define CE_17
#endif
class S{
friend CE_17 auto decltype(f)::operator()() const;
};
int main(){}
```
Should it be rejected ?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs