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

            Bug ID: 25691
           Summary: union conatining non-trivially-copyable member is
                    trivially-copyable itself
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Struct S recognized by type trait  as non-trivially-non-const-copy-assignable,
but union 

struct S
{
    constexpr S() = default;
    constexpr S(S const &) = default;
    constexpr S(S &) = default;
    constexpr S(S &&) = default;
    S & operator = (S const &) = default;
    S & operator = (S &) = default;
    S & operator = (S &&) = default;
};

static_assert(!std::is_trivially_assignable< S &, S & >{}, "!");

union U { S s; };

static_assert(std::is_trivially_assignable< U &, U & >{}, "!");

I use libc++ from trunk and std::is_trivially_assignable uses
`__is_trivially_assignable()` built-in type trait in turn.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to