[libcxx-commits] [PATCH] D143071: [libc++] Add abi_tag on __exception_guard to avoid ODR violations
David Blaikie via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 1 09:59:48 PST 2023
dblaikie added inline comments.
================
Comment at: libcxx/include/__utility/exception_guard.h:126
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard);
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions);
+
----------------
I guess the other changes in the patch to use `__make_exception_guard` are because CTAD can't be used through the alias? If that's true, maybe remove the CTAD support macros here - since it won't be used portably between exception/non-exception code anyway?
================
Comment at: libcxx/include/__utility/exception_guard.h:63
template <class _Rollback>
struct __exception_guard {
__exception_guard() = delete;
----------------
ldionne wrote:
> Instead, let's define two classes, one is `__exception_guard_exceptions` and the other one is `__exception_guard_noexceptions`. Then we can have an alias to the right one.
If they're going to have separate names with an alias - do they need to be/is it better that they not be preprocessor conditional, and only the definition of the alias would need the preprocessor conditionals? Or is it worth keeping the extra code out of the parsing/worth the extra preprocessor conditionality to do so?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143071/new/
https://reviews.llvm.org/D143071
More information about the libcxx-commits
mailing list