Clang has this weird behavior of setting __GNUC__ to 4, hence clang will always take the if branch. This is suboptimal because std::is_trivially_copyable has almost always been in clang. This patch should fix it.
Note that starting with clang 15 a warning is raised for the current implementation:
warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]
Clang has this weird behavior of setting
__GNUC__
to 4, hence clang will always take the if branch. This is suboptimal becausestd::is_trivially_copyable
has almost always been in clang. This patch should fix it.Note that starting with clang 15 a warning is raised for the current implementation:
warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]