https://bugs.llvm.org/show_bug.cgi?id=46584

            Bug ID: 46584
           Summary: win32 std::current_exception miscompilation
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: nok.ra...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

This is probably oversimplified reproducer of Boost crash: 
https://github.com/boostorg/thread/pull/320#issuecomment-653677766

#include <exception>

template <class T>
inline std::exception_ptr make_exception_ptr(T e)
{
    try {
        throw e;
    }
    catch(...) {
        return std::current_exception();
    }
}

struct X {};

int main()
{
    try
    {
        std::rethrow_exception(make_exception_ptr(X{}));
    }
    catch(X const&)
    {
    }
}

clang-cl /O2 /EHsc /DNDEBUG -m32 z.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to