[clang] [AST] Support structural equivalence checking of attributes on Decls (PR #168769)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 22 06:52:23 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,c,cpp -- clang/include/clang/AST/ASTStructuralEquivalence.h clang/include/clang/AST/Attr.h clang/include/clang/Sema/Sema.h clang/lib/AST/ASTStructuralEquivalence.cpp clang/lib/AST/AttrImpl.cpp clang/lib/AST/DeclBase.cpp clang/lib/Index/CommentToXML.cpp clang/lib/Sema/SemaAvailability.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaExprObjC.cpp clang/lib/Sema/SemaHLSL.cpp clang/lib/Sema/SemaObjC.cpp clang/test/C/C23/n3037.c clang/utils/TableGen/ClangAttrEmitter.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/AST/ASTStructuralEquivalence.h b/clang/include/clang/AST/ASTStructuralEquivalence.h
index 8fa21f8a2..2b56273f2 100644
--- a/clang/include/clang/AST/ASTStructuralEquivalence.h
+++ b/clang/include/clang/AST/ASTStructuralEquivalence.h
@@ -171,7 +171,6 @@ struct StructuralEquivalenceContext {
   bool checkDeclQueue();
 
 private:
-
   /// Finish checking all of the structural equivalences.
   ///
   /// \returns true if the equivalence check failed (non-equivalence detected),
@@ -197,7 +196,7 @@ bool isEquivalent(StructuralEquivalenceContext &Context, QualType T1,
 bool isEquivalent(StructuralEquivalenceContext &Context, const Stmt *S1,
                   const Stmt *S2);
 bool isEquivalent(const IdentifierInfo *Name1, const IdentifierInfo *Name2);
-}
+} // namespace ASTStructuralEquivalence
 
 } // namespace clang
 
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 36c0b2b1c..61fb40e79 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1402,8 +1402,7 @@ namespace {
   class VariadicIdentifierArgument : public VariadicArgument {
   public:
     VariadicIdentifierArgument(const Record &Arg, StringRef Attr)
-      : VariadicArgument(Arg, Attr, "const IdentifierInfo *")
-    {}
+        : VariadicArgument(Arg, Attr, "const IdentifierInfo *") {}
   };
 
   class VariadicStringArgument : public VariadicArgument {

``````````

</details>


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


More information about the cfe-commits mailing list