https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90260

            Bug ID: 90260
           Summary: function multiversioning: template functions not
                    supported
           Product: gcc
           Version: 8.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nheart at gmail dot com
  Target Milestone: ---

Created attachment 46252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46252&action=edit
Templated function multiversioning

Hey,

I couldn't find a bug report about this or information about it, so hence this
report:

Function multiversion doesn't seem to support templated functions: Attempting
compilation of the attached example results in a rather confusing error
message: 

g++ test.cpp                                        :(
test.cpp:7:39: error: ambiguating new declaration ‘template<class T> T foo(T)’
 __attribute__ ((target("default"))) T foo(T num) {
                                       ^~~
test.cpp:2:36: note: old declaration ‘template<class T> T foo(T)’
 __attribute__ ((target("avx2"))) T foo(T num) {


Cheers,

Nick

Reply via email to