[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 17:50:42 PDT 2024


================
@@ -153,6 +153,10 @@ RequiresExpr::RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc,
   std::copy(Requirements.begin(), Requirements.end(),
             getTrailingObjects<concepts::Requirement *>());
   RequiresExprBits.IsSatisfied |= Dependent;
+  RequiresExprBits.IsSatisfied &=
+      llvm::none_of(LocalParameters, [](const ParmVarDecl *Param) {
+        return Param->isInvalidDecl();
+      });
----------------
zyn0217 wrote:

I asked author to add it because I saw GCC evaluating such expressions as false.

https://gcc.godbolt.org/z/MYz1oa1TT

This is seemingly more of an open question IMO, given that msvc & edg don't agree with gcc.

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


More information about the cfe-commits mailing list