[libc++] Fix ODR violation with __exception_guard in mixed exceptions builds
authorAlexander Kornienko <alexfh@google.com>
Wed, 1 Feb 2023 12:23:04 +0000 (13:23 +0100)
committerAlexander Kornienko <alexfh@google.com>
Wed, 1 Feb 2023 14:01:12 +0000 (15:01 +0100)
This fix was proposed in https://reviews.llvm.org/D133661#4095018

libcxx/include/__utility/exception_guard.h

index 737d1a6..ccbf75f 100644 (file)
@@ -89,7 +89,7 @@ private:
 };
 #else  // _LIBCPP_NO_EXCEPTIONS
 template <class _Rollback>
-struct __exception_guard {
+struct [[gnu::abi_tag("-fno-exceptions")]] __exception_guard {
   __exception_guard() = delete;
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG explicit __exception_guard(_Rollback) {}