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]

c++/2373: Exception rethrow in function-try-block



>Number:         2373
>Category:       c++
>Synopsis:       Exception rethrow in function-try-block
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 24 03:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Frank Uepping
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
FreeBSD 4.1-RELEASE
>Description:
#include <iostream>


// ISO-IEC-14882 stated in §15.3-16: The exception being handled is rethrown
// if control reaches the end of a handler of the function-try-block of
// a constructor or destructor.


class X
{
 public:
  X ()
  try
  {
    throw int ();
  }
  catch (...)
  {
    // No rethrow! Violates with ISO-IEC-14882 §15.3-16.
    // Same happens for destructor.
  }
};


int main ()
try
{
  X x;
}
catch (...)
{
  std::cerr << "catched exception\n";
}
>How-To-Repeat:

>Fix:

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


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