[clang] [clang] Split up `SemaDeclAttr.cpp` (PR #93966)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 09:19:21 PDT 2024


================
@@ -32,5 +36,87 @@ inline bool isFunctionOrMethodOrBlockForAttrSubject(const Decl *D) {
   return isFuncOrMethodForAttrSubject(D) || llvm::isa<BlockDecl>(D);
 }
 
+/// Return true if the given decl has a declarator that should have
+/// been processed by Sema::GetTypeForDeclarator.
+inline bool hasDeclarator(const Decl *D) {
+  // In some sense, TypedefDecl really *ought* to be a DeclaratorDecl.
+  return isa<DeclaratorDecl>(D) || isa<BlockDecl>(D) ||
+         isa<TypedefNameDecl>(D) || isa<ObjCPropertyDecl>(D);
----------------
AaronBallman wrote:

```suggestion
  return isa<DeclaratorDec, BlockDecl, TypedefNameDecl, ObjCPropertyDecl>(D);
```

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


More information about the cfe-commits mailing list