[clang] [BoundsSafety][NFC] Add counted_by type-shape validation helper (PR #227774)
Yeoul Na via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 9 13:49:37 PDT 2026
================
@@ -49,6 +77,123 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
+/// Check type conflicts under the -fbounds-safety attribute model.
+/// Return std::nullopt if validation should continue with the shared checks.
+static std::optional<bool> checkBoundsAttrTypeConflictsAndMisc(
+ Sema &S, QualType Ty, SourceLocation AttrLoc,
+ const Sema::BoundsAttrFlags &Flags, StringRef AttrSpelling,
+ bool AllowRedecl, Expr *AttrArg) {
+ // The -fbounds-safety model's checks for conflicting attributes, atomic
+ // pointers and array shapes are not upstream yet.
+ return std::nullopt;
+}
+
+bool Sema::ValidateBoundsAttrTypeShape(QualType Ty, SourceLocation AttrLoc,
+ SourceRange AttrRange,
+ BoundsAttrFlags &Flags,
+ StringRef AttrSpelling, bool AllowRedecl,
+ Expr *AttrArg, bool UpdateFlags) {
+ if (getLangOpts().hasBoundsSafetyAttributes())
----------------
rapidsna wrote:
Okay. Let's try to keep then.
https://github.com/llvm/llvm-project/pull/227774
More information about the cfe-commits
mailing list