[llvm-bugs] [Bug 43680] New: Cannot throw move-only object on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 15 08:17:37 PDT 2019


            Bug ID: 43680
           Summary: Cannot throw move-only object on Windows
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at hofst.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22674
  --> https://bugs.llvm.org/attachment.cgi?id=22674&action=edit
Minimal repro. Just `clang test.cpp` on Windows.

If you throw a move-only object on clang/Windows, the compiler will generate
copy that copies the object, even if it is move-only and the copy-constructor
has been deleted. The linker will then fail because it doesn't find a
definition. On Linux/Osx this works as expected. Interestingly, if you make the
copy-constructor private it will work on Windows although the code should be
(technically) unreachable.

Minimal repro in attachment.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191015/34f710f2/attachment.html>

More information about the llvm-bugs mailing list