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++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-21
      Known to work|                            |4.5.1
            Summary|std::uncaught_exception     |[4.7/4.8/4.9 Regression]
                   |always returns true after   |std::uncaught_exception
                   |exception while             |returns true while
                   |constructing another        |constructing exception.
                   |exception.                  |
     Ever confirmed|0                           |1
      Known to fail|                            |4.6.0, 4.7.4, 4.8.2, 4.9.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed. uncaught_exception becomes true while evaluating the operand of the
throw statement, but should only be true after initialization of the exception
object is complete.

#include <exception>

int f()
{
  if (std::uncaught_exception())
    std::terminate();
  return 1;
}

int main()
{
  try
  {
    throw f();
  }
  catch (...)
  {
  }
}


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