Skip to content

[NFC][Clang] Adopt simplified getTrailingObjects in ExprConcepts #143252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Jun 7, 2025

No description provided.

@jurahul jurahul marked this pull request as ready for review June 7, 2025 13:28
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jun 7, 2025
@jurahul jurahul requested a review from erichkeane June 7, 2025 13:29
@llvmbot
Copy link
Member

llvmbot commented Jun 7, 2025

@llvm/pr-subscribers-clang

Author: Rahul Joshi (jurahul)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/143252.diff

1 Files Affected:

  • (modified) clang/include/clang/AST/ExprConcepts.h (+2-6)
diff --git a/clang/include/clang/AST/ExprConcepts.h b/clang/include/clang/AST/ExprConcepts.h
index f988d40cf73c3..8df5cdcaa9d75 100644
--- a/clang/include/clang/AST/ExprConcepts.h
+++ b/clang/include/clang/AST/ExprConcepts.h
@@ -514,10 +514,6 @@ class RequiresExpr final : public Expr,
     return NumLocalParameters;
   }
 
-  unsigned numTrailingObjects(OverloadToken<concepts::Requirement *>) const {
-    return NumRequirements;
-  }
-
   RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc,
                RequiresExprBodyDecl *Body, SourceLocation LParenLoc,
                ArrayRef<ParmVarDecl *> LocalParameters,
@@ -540,13 +536,13 @@ class RequiresExpr final : public Expr,
          unsigned NumRequirements);
 
   ArrayRef<ParmVarDecl *> getLocalParameters() const {
-    return {getTrailingObjects<ParmVarDecl *>(), NumLocalParameters};
+    return getTrailingObjects<ParmVarDecl *>(NumLocalParameters);
   }
 
   RequiresExprBodyDecl *getBody() const { return Body; }
 
   ArrayRef<concepts::Requirement *> getRequirements() const {
-    return {getTrailingObjects<concepts::Requirement *>(), NumRequirements};
+    return getTrailingObjects<concepts::Requirement *>(NumRequirements);
   }
 
   /// \brief Whether or not the requires clause is satisfied.

@jurahul jurahul merged commit 3ebb91d into llvm:main Jun 7, 2025
12 checks passed
@jurahul jurahul deleted the clang_trailingOnjects_ExprConcept branch June 7, 2025 16:56
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants