[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 07:01:09 PDT 2024


================
@@ -6954,6 +6954,23 @@ static void HandleBTFTypeTagAttribute(QualType &Type, const ParsedAttr &Attr,
       ::new (Ctx) BTFTypeTagAttr(Ctx, Attr, BTFTypeTag), Type);
 }
 
+static void handleWrapsAttr(QualType &Type, const ParsedAttr &Attr,
+                            TypeProcessingState &State) {
+  Sema &S = State.getSema();
+  ASTContext &Ctx = S.Context;
+
+  // No need to warn here, that is handled by SemaDeclAttr.
+  // Simply disable applying this attribute.
+  if (S.getLangOpts().CPlusPlus)
----------------
erichkeane wrote:

This shouldn't be required at all with the 'lang opts' suggestion.

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


More information about the cfe-commits mailing list