[llvm-bugs] [Bug 39050] New: is_trivially_copyable_v misbehaves

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 22 12:20:07 PDT 2018


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

            Bug ID: 39050
           Summary: is_trivially_copyable_v misbehaves
           Product: libc++
           Version: 7.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: philippe.groarke at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Tested on various c++17 compatible versions on godbolt.

Assuming cppreference is correct
(https://en.cppreference.com/w/cpp/named_req/TriviallyCopyable) and my
interpretation of their text is also correct.

std::is_trivially_copyable_v doesn't follow the standard's definition.

Example 1, Trivial non-deleted destructor : 
The deleted destructor should fail the check : https://godbolt.org/z/5BOO68

Example 2, at least one copy constructor, move constructor, copy assignment
operator, or move assignment operator is non-deleted :
There are no copy/move ctors or assignement operators, should fail the check :
https://godbolt.org/z/APcHua

I tested on gcc with the same results. I'm assuming I've missed something.

Does libc++ use is_trivially_copyable_v internally for vector resize?

-- 
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/20180922/ed55cfaf/attachment.html>


More information about the llvm-bugs mailing list