[LLVMbugs] [Bug 8105] New: __has_trivial_copy does not work with void, arrays with incomplete or complete bounds

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 7 13:27:32 PDT 2010


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

           Summary: __has_trivial_copy does not work with void, arrays
                    with incomplete or complete bounds
           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


I expect all three of the following tests to fail:

#include <type_traits>

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

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

I therefore expect all of __has_trivial_copy(void), __has_trivial_copy(int[3]),
and __has_trivial_copy(int[]) to return false:


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

int main()
{
    test__has_trivial_copy<void, false>();
    test__has_trivial_copy<int[3], false>();
    test__has_trivial_copy<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