[libcxx-commits] [PATCH] D65667: [libcxx] Avoid destructor call for error_category singletons
Hubert Tong via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 16 15:04:15 PDT 2019
hubert.reinterpretcast added inline comments.
================
Comment at: libcxx/src/system_error.cpp:202
+union GenericAndSystemErrorHelper {
+ struct {
+ __generic_error_category new_generic_error_category;
----------------
mclow.lists wrote:
> Why do you overlay both of these in a single structure?
>
> Is your intent that a program only calls either `generic_category` or `system_category` in any particular run of the program? Otherwise, don't you get UB?
>
These aren't overlaid, but it does mean that there would be an unused instance of one of the types for each helper we create. We should probably avoid that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65667/new/
https://reviews.llvm.org/D65667
More information about the libcxx-commits
mailing list