[llvm-bugs] [Bug 45843] New: please report invalid use of placement new

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 8 09:17:56 PDT 2020


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

            Bug ID: 45843
           Summary: please report invalid use of placement new
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: msan
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael at espindo.la
                CC: llvm-bugs at lists.llvm.org

Created attachment 23465
  --> https://bugs.llvm.org/attachment.cgi?id=23465&action=edit
testcase

As far as I can tell, basic.life makes this code illegal

new (&x) X(std::move(x));

No one would write that directly, but I have hit that with std::swap(x,x) and a
move assignment operator that was using the move constructor.

The attached file is a case where it would be nice to get a warning. It is the
same testcase given to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94992

-- 
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/20200508/ba56eaa1/attachment.html>


More information about the llvm-bugs mailing list