This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error


I received an internal compiler error on the follow code on the "throw" 
statement. The problem was easy to recognize, but I thought I would report 
the bug anyhow.
In "Sample.h" I have:


#include "exception"

class a
{
    class CreateError : public exception
    {
    public:
        CreateError()
            : exception() { };
        virtual ~CreateError() { };
        virtual const char* what() const;
    };
};

class b
{
public:
    void foo();
};


In "Sample.cpp" I have:

#include "Sample.h"

const char* a::CreateError::what() const
{
    return "error thrown";
}

void b::foo()
{
    a var1;
    a *var2 = &var1;

    throw var2->CreateError();
}


ENVIRONMENT:
gcc driver version cygnus-2.7.2-960126 egcs-971225 tornado 2.0 executing 
gcc version cygnus-2.7.2-960126
Windows NT 4.0 SP6
ARGUMENTS:
-g -mcpu=860 -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT -fvolatile 
-fno-builtin -I. -IC:/APPS/Tornado/target/h -IC:/APPS/Tornado/mirror_lib/h 
-DCPU=PPC860 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-align 
-Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline 
-Woverloaded-virtual


Harlan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]