You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[libc++] Introduce a new attribute keyword for Clang improves compatibility with Mingw-GCC
This is affected to only Clang for MinGW target.
In MinGW environment, Clang handles dllexport attribute of internal
class that defined in class template in different way from GCC.
This incompatibility should be fixed but breaks ABI of libc++, so
introduce a new keyword to keep ABI in MinGW environment with
old and patched Clang and to ensure nothing affects to other
environment/platforms.
The new attribute keyword _LIBCPP_INNER_CLASS_IN_TEMPLATE_VIS does
nothing in almost all situations except if included from client
(not in building libc++ itself) by clang (not by GCC or others).
If clang does include libc++, the keyword will be expanded to
__attribute__((__exclude_from_explicit_instantiation__)), results
attached class will be away from explicit instantiation declaration
so will be instanciated implicitly as formar Clang does. Thus,
it will no-op for old Clang that has incompatibility with MinGW-GCC
or emulate old behavior for patched Clang.
This attribute is attached only for std::basic_ostream::sentry and
std::basic_istream::sentry. Other entities won't be affected by
patching Clang so doesn't need to be annotate. Notably, at a time
to introduce a new class as a non-template inner type of a class
template, that class also needs to be attached
_LIBCPP_INNER_CLASS_ININ_TEMPLATE_VIS.
0 commit comments