[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 01:39:09 PDT 2024


https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/85198

None

>From 8925332a806b171bf2e12a7beb257ea85bd0a668 Mon Sep 17 00:00:00 2001
From: huqizhi <huqizhi at feysh.com>
Date: Thu, 14 Mar 2024 16:32:36 +0800
Subject: [PATCH] [Clang][Sema] Fix issue on requires expression with templated
 base class member function

---
 clang/lib/Sema/SemaExpr.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 8725b09f8546cf..31df62d06f1c05 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7729,7 +7729,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
   }
 
   if (CXXMethodDecl *Method = dyn_cast_or_null<CXXMethodDecl>(FDecl))
-    if (Method->isImplicitObjectMemberFunction())
+    if (!isa<RequiresExprBodyDecl>(CurContext) &&
+        Method->isImplicitObjectMemberFunction())
       return ExprError(Diag(LParenLoc, diag::err_member_call_without_object)
                        << Fn->getSourceRange() << 0);
 



More information about the cfe-commits mailing list