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
GCC handles _LIBCPP_INLINE_VISIBILITY differently than Clang. In particular when the attributes are applied to symbols which are externally instantiated.
For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'.
Extended Description
GCC handles _LIBCPP_INLINE_VISIBILITY differently than Clang. In particular when the attributes are applied to symbols which are externally instantiated.
For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'.
// RUN: g++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
// RUN: clang++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
template
struct Foo {
void foo();
void bar();
};
template
void Foo::foo() {}
template
inline attribute((visibility("hidden"), always_inline))
void Foo::bar() {}
template struct Foo;
One way to fix this would be to add _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY which is defined as attribute((visibility("default"), always_inline)).
The text was updated successfully, but these errors were encountered: