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

--- Comment #3 from Larry Smith <admin at hexadigm dot com> ---
Just a follow-up (discovered since original post), if the function in question
is inherited then the issue disappears:

class BaseClass
{
public:
    ////////////////////////////////////////////////////
    // Same as example in my original post but now
    // inherited so "static_cast" below successfully
    // fails compilation (unlike original example where
    // it wasn't inherited - move this back to class
    // "Test" below that is and it erroneously succeeds
    // compilation as per my original post)
    ////////////////////////////////////////////////////
    void Whatever(float)
    {
    }
};

class Test : public BaseClass
{
public:
};

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

    return 0;
}

Reply via email to