public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97951] New: Template specialization of function template fails for fixed-sized SVE vector types.
@ 2020-11-23 14:19 david.tellenbach at arm dot com
  2020-11-23 15:33 ` [Bug c++/97951] " rsandifo at gcc dot gnu.org
  2020-11-23 22:03 ` david.tellenbach at arm dot com
  0 siblings, 2 replies; 3+ messages in thread
From: david.tellenbach at arm dot com @ 2020-11-23 14:19 UTC (permalink / raw)
  To: gcc-bugs

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; }
      |   ^~~~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 14:19 [Bug c++/97951] New: Template specialization of function template fails for fixed-sized SVE vector types david.tellenbach at arm dot com
2020-11-23 15:33 ` [Bug c++/97951] " rsandifo at gcc dot gnu.org
2020-11-23 22:03 ` david.tellenbach at arm dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).