https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121801
Bug ID: 121801
Summary: mangling of _Float16 values in template-args is empty
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mkretz at gcc dot gnu.org
Target Milestone: ---
Test case (https://compiler-explorer.com/z/hEs711h4x):
template <_Float16>
[[gnu::noipa]]
void f() {}
void test()
{
f<1.f16>();
f<2.f16>();
}
f gets mangled as _Z1fILDF16_EEvv for both specializations.
I looked at 'write_real_cst' in cp/mangle.cc. This function assumes that a
real_cst can be split into word size (32 bits). For _Float16, 'words' is 0 and
therefore 'write_real_cst' writes nothing to the mangled name.