[clang] [clang][AST] Make ASTContext::isPFPField() static (PR #220265)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 08:02:05 PDT 2026


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/220265

None

>From 31a917e864e29c9de70970136ca04ec0fee46c9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 1 Sep 2026 17:00:16 +0200
Subject: [PATCH] [clang][AST] Make ASTContext::isPFPField() static

---
 clang/include/clang/AST/ASTContext.h | 2 +-
 clang/lib/AST/ASTContext.cpp         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index f875ae365b892..9fd8741efc1cd 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -3949,7 +3949,7 @@ OPT_LIST(V)
   std::vector<PFPField> findPFPFields(QualType Ty) const;
 
   bool hasPFPFields(QualType Ty) const;
-  bool isPFPField(const FieldDecl *Field) const;
+  static bool isPFPField(const FieldDecl *Field);
 
   /// Returns whether this record's PFP fields (if any) are trivially
   /// copyable (i.e. may be memcpy'd). This may also return true if the
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index b7e771595e86e..34a8610dda97e 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -15695,7 +15695,7 @@ bool ASTContext::hasPFPFields(QualType Ty) const {
   return !findPFPFields(Ty).empty();
 }
 
-bool ASTContext::isPFPField(const FieldDecl *FD) const {
+bool ASTContext::isPFPField(const FieldDecl *FD) {
   if (auto *RD = dyn_cast<CXXRecordDecl>(FD->getParent()))
     return RD->isPFPType() && FD->getType()->isPointerType() &&
            !FD->hasAttr<NoFieldProtectionAttr>();



More information about the cfe-commits mailing list