Date: Thu, 02 Apr 2026 15:59:22 +0000
Ah, shame. Thanks for the answer, though.
On Thursday, April 2nd, 2026 at 4:03 AM, Jens Maurer <jens.maurer_at_[hidden]> wrote:
>
>
> On 4/2/26 05:48, Keenan Horrigan via Std-Discussion wrote:
> > On Clang you can even have
> >
> > template<typename T>
> > consteval auto get_function() {
> > void function(T);
> >
> > return ^^function;
> > }
> >
> > And then get at the overload generically like 'get_function<int>()'. GCC currently runs into an internal error with that, though: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124756
> >
> > But basically, I was wondering if this is valid behavior or not. It would be potentially useful, since I'm not aware of another way to get a reflection of a particular overload from an overload set. But I'm unsure if I could rely on this behavior.
>
> EWG decided to make it ill-formed to apply the reflection operator to block-scope
> extern declarations; see CWG 3065.
>
> https://cplusplus.github.io/CWG/issues/3065.html
>
> Jens
>
On Thursday, April 2nd, 2026 at 4:03 AM, Jens Maurer <jens.maurer_at_[hidden]> wrote:
>
>
> On 4/2/26 05:48, Keenan Horrigan via Std-Discussion wrote:
> > On Clang you can even have
> >
> > template<typename T>
> > consteval auto get_function() {
> > void function(T);
> >
> > return ^^function;
> > }
> >
> > And then get at the overload generically like 'get_function<int>()'. GCC currently runs into an internal error with that, though: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124756
> >
> > But basically, I was wondering if this is valid behavior or not. It would be potentially useful, since I'm not aware of another way to get a reflection of a particular overload from an overload set. But I'm unsure if I could rely on this behavior.
>
> EWG decided to make it ill-formed to apply the reflection operator to block-scope
> extern declarations; see CWG 3065.
>
> https://cplusplus.github.io/CWG/issues/3065.html
>
> Jens
>
Received on 2026-04-02 15:59:29
