The compiler generates the error:
a.cpp: In function ‘int main()’:
a.cpp:6: internal compiler error: in stabilize_call, at cp/tree.c:2248


For this code:

class A {};
class B : public A {};

int main()
{
        throw (A) B();
        return 0;
}

Info:
gcc version 4.1.1
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1-src/configure
Thread model: posix

Command line:
g++ -Wall -ansi -pedantic a.cpp


-- 
           Summary: Throw of a derived class casted to its base class using
                    a C-style cast
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: m dot faustino at gmail dot com


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

Reply via email to