[Bug c++/36910] New: missing diagnostic for initializing function pointer with incompatible exception specification

sebor at roguewave dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 23 16:18:00 GMT 2008


Gcc 4.3.1 fails to diagnose the invalid initialization of pf0 (nothrow)
from f0 (may throw) in the following program.

$ cat t.cpp && gcc -W -Wall -Wno-unused -c -pedantic t.cpp
void f0 () { }
void f1 () throw () { }
void f2 () __attribute__ ((nothrow));


int main ()
{
    void (*pf0)() throw () = f0;   // ill-formed
    void (*pf1)() throw () = f1;   // well-formed
    void (*pf2)() throw () = f2;   // well-formed
}


-- 
           Summary: missing diagnostic for initializing function pointer
                    with incompatible exception specification
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36910



More information about the Gcc-bugs mailing list