std::is_trivially_copyable is still not supported in either of those two compilers (at least as far as gcc 4.6). But both provide __has_trivial_copy directives that do pretty good job.
Except when it comes to deleted copy constructors.
struct A { A(A const&) =delete; };
__has_trivial_copy(A) returns 1 in clang and 0 in gcc.
I was digging in the standard and could not find a clause that says whether the class is still considered trivially copyable when the copy constructor is deleted.
Who's right?
My inclination is to believe that gcc is right, because struct A is not copyable at all, let alone trivially copyable. Also, there's a wide-spread consensus, that a deleted copy constructor can be seen as a privately declared, but not defined constructor, in which case gcc would still be right.
On the other hand, the standard in section 9/6 describes trivial-copyability in terms of not having any non-trivial operations. I guess if you read the standard as written, clang may be right.
__has_trivial_copy(type)??Ais certainly trivially copyable (and there is no problemmemcpying an instance of it). There are certainly somestd::is_foobartype traits that "contradict" the core language foobary specification, but__has_trivial_copyis not defined in the C++ Standard.std::is_trivially_copyable.__has_trivial_copysounds more closely related tostd::is_trivially_copy_constructiblethanstd::is_trivially_copyable. But don't worry, the g++ library guys are smarter than to just use the old extension and assume it's right.