Issue 169937
Summary `std::is_trivially_copyable` is true when all copy/move operations are deleted
Labels new issue
Assignees
Reporter HolyBlackCat
    ```cpp
#include <type_traits>

struct A
{
 A(const A &) = delete;
    A(A &&) = delete;
    A &operator=(const A &) = delete;
    A &operator=(A &&) = delete;
};

static_assert(!std::is_trivially_copyable_v<A>);
```
Here `std::is_trivially_copyable_v<A> == true`, but it should be false.

"Trivially copyable" requires at least one of those 4 members to be "eligible" (https://eel.is/c++draft/class.prop#1.1), which in turn requires it to not be deleted (https://eel.is/c++draft/special#6.1).

GCC has the same bug, but MSVC correctly returns false.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to