Repro:
template <class> class __attribute__((trivial_abi)) a { a(a &&); };
Crash:
@ 0x559d129463fc clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted() @ 0x559d1288d3e5 clang::Sema::checkIllFormedTrivialABIStruct()::$_7::operator()() @ 0x559d12884c34 clang::Sema::checkIllFormedTrivialABIStruct() @ 0x559d1288412e clang::Sema::CheckCompletedCXXClass() @ 0x559d1288d843 clang::Sema::ActOnFinishCXXMemberSpecification() @ 0x559d12020109 clang::Parser::ParseCXXMemberSpecification() @ 0x559d1201e80c clang::Parser::ParseClassSpecifier() @ 0x559d1204e807 clang::Parser::ParseDeclarationSpecifiers() @ 0x559d120e9aa9 clang::Parser::ParseSingleDeclarationAfterTemplate() @ 0x559d120e8f21 clang::Parser::ParseTemplateDeclarationOrSpecialization() @ 0x559d120e8886 clang::Parser::ParseDeclarationStartingWithTemplate() @ 0x559d1204a1d4 clang::Parser::ParseDeclaration() @ 0x559d12004b1d clang::Parser::ParseExternalDeclaration() @ 0x559d12017689 clang::Parser::ParseInnerNamespace() @ 0x559d12017024 clang::Parser::ParseNamespace() @ 0x559d1204a29b clang::Parser::ParseDeclaration() @ 0x559d12004c74 clang::Parser::ParseExternalDeclaration()
This is not the right fallback answer if the class is a dependent type -- we don't yet know if there's a non-deleted copy or move constructor if one might be implicitly declared, so we should conservatively assume that there might be one. It'd probably be easiest to return true from this function at the very start if the type is dependent (because we don't know if there's a non-deleted copy or move constructor).