================
@@ -9192,7 +9194,7 @@ ComputeDefaultedComparisonExceptionSpec(Sema &S, 
SourceLocation Loc,
     EnterExpressionEvaluationContext Context(
         S, Sema::ExpressionEvaluationContext::Unevaluated);
 
-    CXXRecordDecl *RD = cast<CXXRecordDecl>(FD->getLexicalParent());
+    auto RD = getRecordDeclFromFirstParameter(FD);
----------------
zyn0217 wrote:

Hmmm... Does `cast<CXXRecordDecl>(FD->getDeclContext())` work? That way, we can 
avoid the `getRecordDeclFromFirstParameter` whole thing.
I suspect the current approach isn't right here because 1. we have to ensure FD 
is a CXXMethodDecl; 2. the parameter list could be empty and thus we probably 
run into an out-of-bound error.

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

Reply via email to