[llvm-bugs] [Bug 38136] New: Can't take a pointer to a variadic templated function when the variadic args are not the last argument

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 11 10:34:16 PDT 2018


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

            Bug ID: 38136
           Summary: Can't take a pointer to a variadic templated function
                    when the variadic args are not the last argument
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tmathmeyer at chromium.org
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Won't compile on clang++ (works in gcc, msvcc, icc)

template<typename... CA>
void foo(CA... y, int x) {
  x++;
}

int main(int argc, char **argv) {
  void(*bar)(float, int) = &(foo<float>);
  bar(1.4f, 1);
}

Will compile on all compilers:
template<typename... CA>
void foo(int x, CA... y) {
  x++;
}

int main(int argc, char **argv) {
  void(*bar)(int, float) = &(foo<float>);
  bar(1, 1.4f);
}


The only difference here being the order of arguments in foo(). I also tested
this against all the versions of clang++ on https://godbolt.org/ and found it
was broken on all versions up to trunk.

-- 
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/20180711/303d0778/attachment.html>


More information about the llvm-bugs mailing list