[llvm-branch-commits] [Clang] Add pointer field protection feature. (PR #172119)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 12 17:46:55 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,cpp,c -- clang/test/CodeGenCXX/pfp-attribute-disable.cpp clang/test/CodeGenCXX/pfp-coerce.cpp clang/test/CodeGenCXX/pfp-load-store.cpp clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp clang/test/CodeGenCXX/pfp-memcpy.cpp clang/test/CodeGenCXX/pfp-null-init.cpp clang/test/CodeGenCXX/pfp-struct-gep.cpp clang/test/CodeGenCXX/pfp-trivially-relocatable.cpp clang/test/Preprocessor/pfp-predefines.c clang/test/SemaCXX/attr-pointer-field-protection.cpp clang/include/clang/AST/ASTContext.h clang/include/clang/AST/DeclCXX.h clang/lib/AST/ASTContext.cpp clang/lib/AST/DeclCXX.cpp clang/lib/AST/ExprConstant.cpp clang/lib/AST/TypePrinter.cpp clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprAgg.cpp clang/lib/CodeGen/CGExprConstant.cpp clang/lib/CodeGen/CodeGenFunction.cpp clang/lib/CodeGen/CodeGenFunction.h clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h clang/lib/CodeGen/ItaniumCXXABI.cpp clang/lib/CodeGen/MicrosoftCXXABI.cpp clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Frontend/InitPreprocessor.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaTypeTraits.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/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index f37370805..c252a8c16 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -8032,7 +8032,8 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
 
   case ParsedAttr::AT_PointerFieldProtection:
     if (!S.getLangOpts().PointerFieldProtectionAttr)
-      S.Diag(AL.getLoc(), diag::err_attribute_pointer_field_protection_experimental)
+      S.Diag(AL.getLoc(),
+             diag::err_attribute_pointer_field_protection_experimental)
           << AL << AL.isRegularKeywordAttribute() << D->getLocation();
     handleSimpleAttribute<PointerFieldProtectionAttr>(S, D, AL);
     break;

``````````

</details>


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


More information about the llvm-branch-commits mailing list