Open wanghan02 opened 1 year ago
@llvm/issue-subscribers-clang-frontend
CC @royjacobson I think this is related to https://reviews.llvm.org/D128619 but I am not sure what the correct outcome here is
Looks as it should be trivially copyable, I'll take a look. Thanks!
So we have this method in CXXRecordDecl
bool hasNonTrivialCopyAssignment() const {
return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
!hasTrivialCopyAssignment();
}
and it returns a wrong result in this case: no non trivial copy assignment is present but no trivial one exists either. Need to check what the actual logic should be.
@llvm/issue-subscribers-c-20
Author: Han (wanghan02)
Code as below or on Godbolt. Clang 16/trunk believes
S<int>
is not a trivially copyable class. Clang 15, GCC trunk and MSVC believe otherwise.According to the standard:
S<int>
has trivial copy/move constructor and trivial destructor. Its copy assignment operator is not eligible because its constraint is not satisfied. Its move assignment operator is not eligible because it's not declared. Is this a Clang bug?