[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
Sat Apr 13 05:58:58 PDT 2024


================
@@ -7735,7 +7735,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
   }
 
   if (CXXMethodDecl *Method = dyn_cast_or_null<CXXMethodDecl>(FDecl))
-    if (Method->isImplicitObjectMemberFunction())
+    if (!isa<RequiresExprBodyDecl>(CurContext) &&
----------------
jcsxky wrote:

Do you mean that checking whether `Method` is an implicit object function is redundant? After I removed https://github.com/llvm/llvm-project/blob/844b532713986999aa1ffed0883eff2d1339ec7a/clang/lib/Sema/SemaExpr.cpp#L7723-L7726
These testcase failed

https://github.com/llvm/llvm-project/blob/844b532713986999aa1ffed0883eff2d1339ec7a/clang/test/CXX/drs/dr3xx.cpp#L1084-L1095
https://github.com/llvm/llvm-project/blob/844b532713986999aa1ffed0883eff2d1339ec7a/clang/test/SemaTemplate/instantiate-using-decl.cpp#L150-L168
with no diagnose. Or the checking shouldn't be placed at current position?

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


More information about the cfe-commits mailing list