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

            Bug ID: 65382
           Summary: pointer-to-noexcept-function typealias allowed via
                    using
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vgheorgh at gmail dot com

According to 15.4 Exception specifications [except.spec]/2, the following code
should be rejected, 

#include <iostream>

using fptr = void(*)() noexcept; // should not be accepted
// typedef void (*FPTR)() noexcept; // rejected by the compiler

void f() noexcept
{
    std::cout << "void f() noexcept" << std::endl;
}

int main()
{
    fptr fp = f;
    fp();
}


Replacing using with a typedef makes the compiler emit an error, however the
code above compiles just fine, and it shouldn't.

Reply via email to