https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125957
Bug ID: 125957
Summary: Error when splicing reflection of private member
function
Product: gcc
Version: 17.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/Gj5W7eadd
Clang accepts this
```
class A {
void f() {}
};
constexpr auto members = std::define_static_array(members_of(^^A,
std::meta::access_context::unchecked()));
int main() {
template for (constexpr auto member : members) {
if constexpr (has_identifier(member) && (identifier_of(member)
== "f")) {
A().[:member:]();
}
}
}
```
```
<source>:12:39: error: 'void A::f()' is private within this context
12 | A().[:member:]();
| ~~~~~~~~~~~~~~^~
```