Parse error with throw

Benoit Sibaud
Fri May 26 01:10:00 GMT 2000


I'm not sure it is really a bug. I only know that both 'throw
exception()' and '(throw exception())' work with Sun CC 5.0. I don't
know what is said by the C++ norm.

class exception

int main()
  throw (exception());

$ gcc -v --save-temps foo.cpp
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix
-D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386)
-Di386 -D__i386 -D__i386__ foo.cpp foo.ii
GNU CPP version 2.95.2 20000313 (Debian GNU/Linux) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
The following default directories have been omitted from the search
End of omitted list.
 /usr/lib/gcc-lib/i386-linux/2.95.2/cc1plus foo.ii -quiet -dumpbase -version -o foo.s
GNU C++ version 2.95.2 20000313 (Debian GNU/Linux) (i386-linux) compiled
by GNU C version 2.95.2 20000313 (Debian GNU/Linux).
foo.cpp: In function `int main()':
foo.cpp:7: parse error before `;'

Benoît Sibaud
R&D Engineer France Telecom/BD/FTR&D/DAC/OAT

More information about the Gcc-bugs mailing list