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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 07:59:16 PDT 2019


aaron.ballman added inline comments.


================
Comment at: clang/include/clang-c/Index.h:227
+  /**
+   * The cursor has a declspec(nothrow) exception specification.
+   */
----------------
`__declspec(nothrow)`


================
Comment at: clang/include/clang/Basic/ExceptionSpecificationType.h:25
   EST_MSAny,            ///< Microsoft throw(...) extension
+  EST_NoThrow,          ///< Microsoft declspec(nothrow) extension
   EST_BasicNoexcept,    ///< noexcept
----------------
`__declspec(nothrow)`


================
Comment at: clang/lib/Sema/SemaType.cpp:6968
+
+    // MSVC Ignores nothrow for exception specification if it is in conflict.
+    if (Proto->hasExceptionSpec())
----------------
Ignores -> ignores


================
Comment at: clang/lib/Sema/SemaType.cpp:6970
+    if (Proto->hasExceptionSpec())
+      return true;
+
----------------
I think we should diagnose that the `nothrow` is ignored in this case to let users know they've done something in conflict and what wins.


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

https://reviews.llvm.org/D62435





More information about the cfe-commits mailing list