[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 16:22:14 PDT 2019


rsmith requested changes to this revision.
rsmith added a comment.
This revision now requires changes to proceed.

Seems like a nice approach to the problem, but we need to not break the libclang C ABI :)



================
Comment at: clang/include/clang-c/Index.h:202-204
+   * The cursor has a declspec(nothrow) exception specification.
+   */
+  CXCursor_ExceptionSpecificationKind_NoThrow,
----------------
This would renumber the later enumerators, resulting in an ABI break for our stable C ABI.


================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:6067-6068
   if (EST2 == EST_NoexceptTrue) return ESI1;
+  if (EST1 == EST_NoThrow) return ESI2;
+  if (EST2 == EST_NoThrow) return ESI1;
 
----------------
I think this should be checked earlier, in the spirit of allowing "real" syntax to be preferred to attributes. (Eg, given a declaration that's `__declspec(nothrow)` and one that's `noexcept`, we should keep the `noexcept` in the merged type.)


Repository:
  rC Clang

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

https://reviews.llvm.org/D62435





More information about the cfe-commits mailing list