[PATCH] D17893: Sema: Add semantic analysis for the C++ ABI stability attributes and whitelist.

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 13:27:03 PDT 2016


pcc added inline comments.

================
Comment at: lib/Sema/SemaDeclCXX.cpp:4935-4943
@@ +4934,11 @@
+
+  bool HasStableAttr = Record->hasAttr<StableABIAttr>();
+  bool HasUnstableAttr = Record->hasAttr<UnstableABIAttr>();
+  if (HasStableAttr && HasUnstableAttr) {
+    Diag(Record->getLocation(), diag::err_abi_mismatch) << Record;
+    Diag(Record->getAttr<StableABIAttr>()->getLocation(),
+         diag::note_abi_stability_attr) << /*Unstable=*/false;
+    Diag(Record->getAttr<UnstableABIAttr>()->getLocation(),
+         diag::note_abi_stability_attr) << /*Unstable=*/true;
+  }
+
----------------
rjmccall wrote:
> No, ms_struct is a request for a specific ABI; this would be a conflict.
Fair point. I think we can handle this by making `ms_struct` imply `stable_abi` in the same way that `uuid` would imply `stable_abi`. Then there would be a conflict between `ms_struct` and `unstable_abi`, and we would infer the correct ABI in implied namespaces.

Are there any other attributes like that? I could only find `vecreturn` and `novtable`.


http://reviews.llvm.org/D17893





More information about the cfe-commits mailing list