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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-08-01
           Keywords|                            |accepts-invalid
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. the testcase that is incorrect accepted:
```
struct Test
{
    void Whatever(float) { }
};

int main()
{
    constexpr auto pWhatever = static_cast<void (Test::*)(float)
noexcept>(&Test::Whatever);

    return 0;
}
```

GCC does reject it if not a pointer to member function though:
```
struct Test
{
   static  void Whatever(float) { }
};

int main()
{
    constexpr auto pWhatever
    = static_cast<void (*)(float) noexcept>(&Test::Whatever);
}
```

Reply via email to