Closed
Description
For the following source clang
generates the symbol _ZN1tIcE3barILi1EEEvv
with the DEFAULT
visibility:
template <class a>
struct t {
template <int>
static __attribute__((__visibility__("hidden")))
void bar() {}
};
void test() {
t<char>::bar<1>();
}
> clang -c test.cpp -target x86_64 -o test.o
> readelf -sW test.o
...
5: 0000000000000000 6 FUNC WEAK DEFAULT 5 _ZN1tIcE3barILi1EEEvv
gcc
for the same case generates a HIDDEN
symbol: https://godbolt.org/z/9z7soKfoa
The problem may be similar to #31462, but there are no explicit instantiations with different visibility attributes here. Applying D153835 or D154774 fixes this issue, but these revisions seem to be abandoned. #72092 does not resolve it.