[LLVMbugs] [Bug 13125] New: Simple try-catch with std::cout throws std::ios_base::failure exception

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 16 01:26:26 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13125

             Bug #: 13125
           Summary: Simple try-catch with std::cout throws
                    std::ios_base::failure exception
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vanboxem.ruben at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8719
  --> http://llvm.org/bugs/attachment.cgi?id=8719
-S output for GCC 4.7.0 and Clang 3.2pre

This test code:
-----
#include <iostream>

int main()
{
try
{
throw 5;
}
catch(int i)
{
std::cout << "Caught int: " << i << "\n";
}
}
----
Produces an extra exception when compiled with Clang 3.2pre (r158153) with GCC
4.7.0 libstdc++. GCC itself does not show this problem. I attached the asm
generated by the compilers in question (which can be downloaded as the
gcc-4.7.0-clang-3.2pre package from here
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/experimental/
)

Using std::cout without throw-catch works fine. Switching to printf from
<cstdio> also works fine. I attached the two asm files produced by running
[clan]g++ -O0 test.cpp -S -o [clang|gcc]asm.S
on the above code.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list