Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-76

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 4.1.2
    • 4.1.3
    • 18. Language Support
    • None
    • 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

      Attachments

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: