Can copy constructor S(S&) be non-trivial?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can copy constructor S(S&) be non-trivial?

Alex Denisov via cfe-dev
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:


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev