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]
Other format: [Raw text]

[Bug c++/14740] New: c++ parser doesn't accept arguments to throw in brackets


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


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