C++ Standard Library
  1. C++ Standard Library
  2. STDCXX-76

[MSVC 8.0] std::uncaught_exception() always true

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.3
    • Component/s: 18. Language Support
    • Labels:
      None
    • Environment:

      MSVC 7.0, 7.1, 8.0

      Description

      The program below aborts at runtime when compiled with MSVC 7.1.

      $ cat t.cpp && nmake t.exe && PATH=/build/sebor/build-hal/lib ./t.exe
      #include <cassert>
      #include <exception>

      bool uncaught;

      struct S { ~S ()

      { uncaught = std::uncaught_exception (); }

      };

      int main ()
      {
      try

      { S s; throw 0; }

      catch (...) { }

      assert (uncaught);
      assert (!std::uncaught_exception ());
      }

      Microsoft (R) Program Maintenance Utility Version 7.10.3077
      Copyright (C) Microsoft Corporation. All rights reserved.

      cl -D_RWCONFIG=15d_msvc_7_1 -Ic:\contrib\cygwin\build\sebor\dev-hal/include -I.\..\..\..\../include -Ic:\contrib\cygwin\build\sebor\dev-hal\tests\stdlib\support/../include -Ic:/contrib/cygwin/build/sebor/dev-hal/include/ansi -I.\..\..\..\.. -Ic:\contrib\cygwin\build\sebor\dev-hal -Ic:\contrib\cygwin\build\sebor\dev-hal\tests\stdlib\support -I. -nologo -GX -MDd -W3 -Zi -GR -GF -GZ -c t.cpp
      t.cpp
      link -nologo /NODEFAULTLIB:msvcprtd /debug /LIBPATH:.\..\..\..\..\lib /OUT:t.exe t.obj testx15d_msvc_7_1.lib tlt15d_msvc_7_1.lib std15d_msvc_7_1.lib user32.lib
      Assertion failed: !std::uncaught_exception (), file t.cpp, line 17

        Activity

        Martin Sebor created issue -
        Martin Sebor made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Martin Sebor made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Martin Sebor made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Martin Sebor
            Reporter:
            Martin Sebor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development