[cfe-dev] Can copy constructor S(S&) be non-trivial?

Akira Hatanaka via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 15 11:01:59 PST 2017


Quick question about copy constructors. Is "istrivial" true in the
following example? clang thinks it is not trivially-copyable but gcc seems
to disagree.

#include <type_traits>
struct S {
S(S&) = default;
};
bool istrivial = std::is_trivially_copyable<S>::value;

If I understand the following defect report correctly, gcc seems correct:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2171
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171215/18d04ad8/attachment.html>


More information about the cfe-dev mailing list