[LLVMbugs] [Bug 8109] New: __has_trivial_assign not working for void and arrays

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 7 16:37:06 PDT 2010


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: unassignedclangbugs at nondot.org
        ReportedBy: hhinnant at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


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.



More information about the llvm-bugs mailing list