https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97951
Bug ID: 97951 Summary: Template specialization of function template fails for fixed-sized SVE vector types. Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: david.tellenbach at arm dot com Target Milestone: --- Following the ACLE for SVE Version 00bet6, fixed-length types can be declared by using the __attribute__((arm_sve_vector_bits(N))) type attribute. However, the following snippet fails using g++-10 (Ubuntu 10.1.0-2ubuntu1~18.04) 10.1.0: g++-10 -march=armv8-a+sve -msve-vector-bits=512 main.cc -c main.cc: #include <arm_sve.h> typedef svfloat32_t PacketXf __attribute__((arm_sve_vector_bits(512))); template<typename T> T func(const float& f) { return f; } template<> PacketXf func(const float& f) { return svdup_n_f32(f); } producing the following diagnostics: main.cc:9:10: error: template-id 'func<>' for 'PacketXf func(const float&)' does not match any template declaration 9 | PacketXf func(const float& f) { return svdup_n_f32(f); } | ^~~~ main.cc:6:3: note: candidate is: 'template<class T> T func(const float&)' 6 | T func(const float& f) { return f; } | ^~~~