================
@@ -1013,17 +1015,18 @@ class CXXRecordDecl : public RecordDecl {
/// assignment operator or if any existing special member function inhibits
/// this.
bool needsImplicitMoveAssignment() const {
+ // In HLSL, only built-in records like resources classes can have
+ // constructors and overloadable operators.
+ if (getLangOpts().HLSL && !hasUserProvidedSpecialMembers())
+ return false;
+
return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
!hasUserDeclaredCopyConstructor() &&
!hasUserDeclaredCopyAssignment() &&
- !hasUserDeclaredMoveConstructor() && !hasUserDeclaredDestructor() &&
- (!isLambda() || lambdaIsDefaultConstructibleAndAssignable()) &&
- // In HLSL, only built-in records like resources classes can have
- // constructors.
- (!getLangOpts().HLSL ||
- (isLambda() && lambdaIsDefaultConstructibleAndAssignable()) ||
- hasUserProvidedSpecialMembers());
- }
+ !hasUserDeclaredMoveConstructor() &&
+ !hasUserDeclaredDestructor() &&
+ (!isLambda() || lambdaIsDefaultConstructibleAndAssignable());
----------------
bob80905 wrote:
You've removed the `isLambda()` condition from functions in charge of implicit
Default/Copy/Move Constructors, and Copy assignment, but left this isLambda
function for this implicit move assignment. Is this intentional, or should we
remove the call to the lambda functions here, or reinstate the lambda checks
for the functions mentioned above?
https://github.com/llvm/llvm-project/pull/194989
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits