================
@@ -759,19 +759,40 @@ class CXXRecordDecl : public RecordDecl {
            needsImplicitDefaultConstructor();
   }
 
+  // Used by HLSL to determine if a record is a built-in implicit HLSL
+  // struct/class or a user-defined one. User-defined HLSL records cannot
+  // have ctors, dtors, or overloaded operators, while implicit built-in
+  // HLSL records such as resource classes can. It would be nice to use the
+  // isImplicit() methods to determine that, but this flag is not propagated
+  // to template-instanticated classes.
+  //
+  /// Determines whether this class has any user provided special members.
+  bool hasUserProvidedSpecialMembers() const {
+    return data().UserDeclaredSpecialMembers &
+               (SMF_MoveConstructor | SMF_MoveAssignment | SMF_Destructor |
----------------
hekota wrote:

Good idea! We actually need to check for default constructors as well. I have 
simplified the condition.

https://github.com/llvm/llvm-project/pull/194989
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to