https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123661
Bug ID: 123661
Summary: [reflection] Cannot return a pointer member from a
splice expression
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: boris.staletic at protonmail dot com
Target Milestone: ---
Created attachment 63376
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63376&action=edit
Preprocessed snippet
This snippet
```
#include <meta>
template<std::meta::info f>
consteval auto build_overload() {
return &[:f:];
}
struct Test {
void myfn() {}
int x;
};
constexpr auto x = build_overload<^^Test::myfn>();
```
Errors with
```
example.cpp: In instantiation of 'consteval auto build_overload() [with
std::meta::info f = ^^Test::myfn]':
required from here
example.cpp:11:48:
11 | constexpr auto x = build_overload<^^Test::myfn>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
example.cpp:5:16: error: invalid use of 'Test::myfn' to form a
pointer-to-member-function
5 | return &[:f:];
| ^~~~~~
example.cpp:5:16: note: a qualified-id is required
Compiler returned: 1
```