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

Florian Mayer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 4 16:35:49 PST 2025


================
@@ -3141,6 +3141,17 @@ defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti"
   NegFlag<SetFalse, [], [CC1Option], "Do not omit">,
   BothFlags<[], [CC1Option], " the RTTI component from virtual tables">>;
 
+defm experimental_pointer_field_protection : BoolFOption<"experimental-pointer-field-protection",
+  LangOpts<"PointerFieldProtection">, DefaultFalse,
+  PosFlag<SetTrue, [], [CC1Option], "Enable">,
+  NegFlag<SetFalse, [], [], "Do not enable">,
+  BothFlags<[], [ClangOption], " pointer field protection on all non-standard layout struct types">>;
+defm experimental_pointer_field_protection_tagged : BoolFOption<"experimental-pointer-field-protection-tagged",
----------------
fmayer wrote:

as discussed offline, i would prefer if there was a flag to enable the `[[clang:pointer_field_protection]]` while this feature is experimental to avoid accidental enablement

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


More information about the llvm-branch-commits mailing list