https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105645
Wenzhuo Liu <wenzhuo.liu.25519 at qq dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wenzhuo.liu.25519 at qq dot com
--- Comment #6 from Wenzhuo Liu <wenzhuo.liu.25519 at qq dot com> ---
I can reproduce this on current trunk (194d91912cb) and on GCC 16.2, and I
think
I found why it happens.
Minimal testcase:
template <typename T> void f (T); template <> void f (int) {}
$ g++ -O2 -fvisibility=hidden -c t.cc $ readelf -sW t.o | grep _Z1fIi
3: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 _Z1fIiEvT_
clang 22 emits that symbol HIDDEN.
I tried bisect this issue and the first bad commit is
b9e75696307f710a22c726e72b00e7a7161ad89f (2006-06-29, Jason Merrill). So the
behaviour appeared in GCC 4.2.0; GCC 4.1.2 and earlier were not affected
I have a quick patch that can fix this issue, but before I sending it. I'd like
to know whether this considered a bug or not. Do we have any other concerns
given that it has been ~20 years?