[PATCH] D64600: [ObjC] Add an attribute that "clamps" signed char BOOLs to {0,1}

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 10:44:21 PDT 2019


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:3279
+def ObjCClampingBool : TypeAttr {
+  let Spellings = [Clang<"objc_clamping_bool">];
+  let Subjects = SubjectList<[TypedefName]>;
----------------
Is there a desire for similar functionality for C's `_Bool` datatype, or other, custom datatypes (perhaps `BOOL` from the Win32 APIs)? It seems like this attribute could be generalized to apply to any typedef to an integral type.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64600/new/

https://reviews.llvm.org/D64600





More information about the cfe-commits mailing list