https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124312

Mishmish Dev <mishmish at mishmish dot dev> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mishmish at mishmish dot dev

--- Comment #6 from Mishmish Dev <mishmish at mishmish dot dev> ---
(In reply to Jonathan Wakely from comment #5)
> This seems like the simplest fix for the gcc-16 branch (it already works on
> trunk):
> 
> --- a/libstdc++-v3/include/bits/c++config
> +++ b/libstdc++-v3/include/bits/c++config
> @@ -440,6 +440,12 @@ _GLIBCXX_END_NAMESPACE_VERSION
>  #define _GLIBCXX_ASSERTIONS 1
>  #endif
>  
> +// Likewise for reflection, as the debug mode vector<meta::info> doesn't
> work.
> +#if defined(_GLIBCXX_DEBUG) && defined(__cpp_impl_reflection)
> +#undef _GLIBCXX_DEBUG
> +#define _GLIBCXX_ASSERTIONS 1
> +#endif
> +
>  // Inline namespaces for special modes: debug, parallel.
>  #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
>  namespace std

I don't think this is a good idea. Turns -freflection into an ABI switch.

Example of mixing TUs with and without reflection creating ODR violation:
https://godbolt.org/z/Ws9xj5Ev3

Reply via email to