================
@@ -6697,6 +6697,10 @@ static bool canPassInRegisters(Sema &S, CXXRecordDecl *D,
   if (D->isDependentType() || D->isInvalidDecl())
     return false;
 
+  for (const CXXMethodDecl *MD : D->methods()) {
----------------
vortex73 wrote:

I see two potential alternative approaches we could take:

1. Move the validity check to the copy constructor query logic specifically, so 
we only check the relevant constructor's validity. This would be more targeted 
than checking all methods.

2. Handle this earlier in the call chain where we first detect an invalid copy 
constructor, preventing us from reaching canPassInRegisters in the first place.

Which approach do you think would be more appropriate? I can work on a revised 
patch based on your preferred direction.

For context, I was trying to prevent the assertion failure when dealing with 
invalid constructors and @shafik mentioned `canPassInRegisters`, but agree we 
should handle this more gracefully and in a more appropriate location.

https://github.com/llvm/llvm-project/pull/124819
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to