This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Parse error with throw
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Parse error with throw
- From: Benoit Sibaud <benoit dot sibaud at rd dot francetelecom dot fr>
- Date: Fri, 26 May 2000 10:09:59 +0200
- Organization: France Telecom R&D
Hi,
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:
/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/lib/gcc-lib/i386-linux/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search
path:
/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
End of omitted list.
/usr/lib/gcc-lib/i386-linux/2.95.2/cc1plus foo.ii -quiet -dumpbase
foo.cc -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