c++/10299: parsing error: unqualified type-name from base-class in c-tor's exception specification

boris@kolpackov.net boris@kolpackov.net
Wed Apr 2 20:16:00 GMT 2003


>Number:         10299
>Category:       c++
>Synopsis:       parsing error: unqualified type-name from base-class in c-tor's exception specification
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 02 20:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     boris@kolpackov.net
>Release:        g++ (GCC) 3.3 20030331 (prerelease)
>Organization:
>Environment:
linux-i686; ./configure --enable-threads=posix
>Description:
The code below causes the following output.

bash-2.05a$ /usr/local/bin/g++ -Wall ./ExceptionSpecCtor.cpp
ExceptionSpecCtor.cpp:13: error: parse error before `)' token
ExceptionSpecCtor.cpp:14: error: declaration of `Derived::Derived()' throws
   different exceptions
ExceptionSpecCtor.cpp:9: error: than previous declaration `Derived::Derived()
   throw (Base::E)'

Note that if I comment c-tor out everyhting compiles fine even though foo () member functions uses semantically the same construct.

--------------------------------------
struct Base
{
  class E {};
};

struct Derived : public virtual Base
{
  Derived () throw (E);
  void foo () throw (E);
};

Derived::Derived () throw (E)
{
}

void Derived::foo () throw (E)
{
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list