http://llvm.org/bugs/show_bug.cgi?id=8109

           Summary: __has_trivial_assign not working for void and arrays
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Because I expect the following three tests to result in invalid code:


#include <type_traits>

template <class T>
void
test()
{
    std::declval<T&>() = std::declval<const T&>();
}

int main()
{
    test<void>();
    test<int[3]>();
    test<int[]>();
}

I expect the following __has_trivial_assign tests to pass (return false):


template <class T, bool Result>
void
test__has_trivial_assign()
{
    static_assert(__has_trivial_assign(T) == Result, "");
}

int main()
{
    test__has_trivial_assign<void, false>();
    test__has_trivial_assign<int[3], false>();
    test__has_trivial_assign<int[], false>();
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to