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]

namespace std and EH



Dear Mr. Merrill,
Why does the first programm crash the compiler and the second compile
as  expected?

I believe both of them should generate identical compiler output.

Peter Schmid

a) test.C
#include <exception>

class A {
    class B : public std::exception {}
    ;
};
g++ -v -c test.C
Reading specs from /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.90.19/specs
gcc version egcs-2.90.19 971127 (gcc2-970802 experimental)
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.90.19/cpp -lang-c++ -v
-undef  -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90
-D__ELF__  -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux  -Asystem(posix) -D__EXCEPTIONS -Di386 -Asystem(unix)
-Acpu(i386)  -Amachine(i386) -D__i386__ -Asystem(unix) -Acpu(i386)
-Amachine(i386)  test.C /dos/tmp/cca16528.ii
GNU CPP version egcs-2.90.19 971127 (gcc2-970802 experimental) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++
 /usr/local/include
 /usr/i386-pc-linux-gnulibc1/include
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.90.19/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.90.19/cc1plus
/dos/tmp/cca16528.ii  -quiet -dumpbase test.cc -version -o /dos/tmp/cca16528.s
GNU C++ version egcs-2.90.19 971127 (gcc2-970802 experimental)
(i386-pc-linux-gnulibc1)  compiled by GNU C version egcs-2.90.19 971127 (gcc2-970802 experimental).
test.C:4: Internal compiler error.
test.C:4: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Compilation exited abnormally with code 1 at Fri Nov 28 21:09:10

b) test-geht.C
#include <exception>
//using namespace std;
class A {
    class B : public exception {}
    ;
};
g++ -c test-geht.C 

Compilation finished at Fri Nov 28 21:10:43




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