This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14740] New: c++ parser doesn't accept arguments to throw in brackets
- From: "maierkom at rcs dot ei dot tum dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2004 10:16:53 -0000
- Subject: [Bug c++/14740] New: c++ parser doesn't accept arguments to throw in brackets
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
c++ parser doesn't like if the argument to a throw statement
is inclosed in brackets. I don't know wheather this is allowed
or forbidden by the standard, but other compilers like the
intel and the sun compiler accept it.
============ example ======================
#include <exception>
class my_exc : public std::exception
{
public:
my_exc(void)
: std::exception()
{ }
const char *what(void) const throw()
{
return "my_exc";
}
};
void thrower(void)
{
// g++ doesn't like the following line, because of the brackets around
my_exc()
// intel cc and sun cc accept this construct
throw (my_exc());
}
int main(void)
{
try {
thrower();
} catch (...) {
}
return 0;
}
--
Summary: c++ parser doesn't accept arguments to throw in brackets
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: maierkom at rcs dot ei dot tum dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: any
GCC host triplet: any
GCC target triplet: any
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14740