@@ -391,7 +391,7 @@ typedef __char32_t char32_t;
391391# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
392392# define _LIBCPP_TEMPLATE_VIS
393393# define _LIBCPP_TEMPLATE_DATA_VIS
394- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT
394+ # define _LIBCPP_NAMESPACE_VISIBILITY
395395
396396# else
397397
@@ -419,17 +419,16 @@ typedef __char32_t char32_t;
419419# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
420420# endif
421421
422- // GCC doesn't support the type_visibility attribute, so we have to keep the visibility attribute on templates
423- # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && !__has_attribute(__type_visibility__)
424- # define _LIBCPP_TEMPLATE_VIS __attribute__ ((__visibility__(" default" )))
425- # else
426- # define _LIBCPP_TEMPLATE_VIS
427- # endif
422+ // This is kept to avoid a huge library-wide diff in the first step.
423+ // TODO: Remove this in a follow-up patch
424+ # define _LIBCPP_TEMPLATE_VIS
428425
429426# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
430- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT __attribute__ ((__type_visibility__(" default" )))
427+ # define _LIBCPP_NAMESPACE_VISIBILITY __attribute__ ((__type_visibility__(" default" )))
428+ # elif defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
429+ # define _LIBCPP_NAMESPACE_VISIBILITY __attribute__ ((__visibility__(" default" )))
431430# else
432- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT
431+ # define _LIBCPP_NAMESPACE_VISIBILITY
433432# endif
434433
435434# endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
@@ -588,7 +587,7 @@ typedef __char32_t char32_t;
588587// If it's not clear whether using the unversioned namespace is the correct thing to do, it's not. The versioned
589588// namespace (_LIBCPP_BEGIN_NAMESPACE_STD) should almost always be used.
590589# define _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD \
591- _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {
590+ _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_NAMESPACE_VISIBILITY std {
592591
593592# define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_POP_EXTENSION_DIAGNOSTICS
594593
0 commit comments