[llvm-bugs] [Bug 41613] New: Function multiversioning doesn't support function templates

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 26 06:29:34 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41613

            Bug ID: 41613
           Summary: Function multiversioning doesn't support function
                    templates
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nheart at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 21825
  --> https://bugs.llvm.org/attachment.cgi?id=21825&action=edit
Templated function multiversioning

Hey,

Function multiversioning doesn't seem to support function templates. AFAIK
there was some discussion about it where function templates were left out of
the implementation as it didn't work in gcc back then:
https://reviews.llvm.org/D51650

The example code attached fails to compile with:

clang++ test.cpp 
test.cpp:7:39: error: attribute 'target' multiversioned functions do not yet
      support function templates
__attribute__ ((target("default"))) T foo(T num) {
                                      ^

To be fair, GCC still doesn't do that (yet) but I have opened a bug report over
there as well: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90260

Are there plans to support this?

Cheers,

Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190426/d123b357/attachment-0001.html>


More information about the llvm-bugs mailing list