https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124177

            Bug ID: 124177
           Summary: [reflection] annotation denoting function rejected
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mfwippich at gmail dot com
  Target Milestone: ---

Currently, the following code is rejected:

```
void f();
[[=f]] void bar();
```

[dcl.attr.annotation]/2 specifies the underlying constant of an annotation as
the result of `std::meta::reflect_constant(expr)`. Since `reflect_constant` is
currently specified as
```
template<class T>
  consteval info reflect_constant(T expr);
```
I would expect an adjustment from function/array type to pointer type (as per
[dcl.fct]/4) to happen, which should make this annotation legal.

ie
```
void f();
static_assert([:std::meta::reflect_constant(f):] == &f);
```
is being accepted (https://compiler-explorer.com/z/oPrsEMaPs).


Note that the signature of `reflect_constant` has changed a few times. In
P2996R7 the parameter type was changed to `const T&`, it got changed back to
`T` in R13.

Reply via email to