================
@@ -2504,6 +2504,19 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction(
   if (Method->getCanonicalDecl()->isDeleted())
     SPFlags |= llvm::DISubprogram::SPFlagDeleted;
 
+  const bool isExplicitlyDefaultable =
+      isa<CXXDestructorDecl>(Method) ||
+      (isa<CXXConstructorDecl>(Method) &&
+       cast<CXXConstructorDecl>(Method)->isDefaultConstructor()) ||
+      Method->isCopyOrMoveConstructorOrAssignment();
----------------
Michael137 wrote:

In C++20 comparison operators can also be defaulted: 
https://en.cppreference.com/cpp/language/default_comparisons

And in c++29 
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3668r1.html

So maybe there ought to be a helper in Clang that gives us this info

Looks like `Sema::getDefaultedFunctionKind(const FunctionDecl *FD)` might be 
what you need. It also supports the comparison operators (and will support any 
new defaulted special member kinds in the future)

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

Reply via email to