-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
c++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second party
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.
Metadata
Metadata
Assignees
Labels
c++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second party