[LLVMbugs] [Bug 19802] New: Clang deduces conflicting types when using a "using template"-defined variadic function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 20 03:48:36 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19802

            Bug ID: 19802
           Summary: Clang deduces conflicting types when using a "using
                    template"-defined variadic function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dontbugme at mailinator.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12545
  --> http://llvm.org/bugs/attachment.cgi?id=12545&action=edit
Failing test case

Instantiating a templated variadic function type incorrectly fails, for
example:

=============================================================
template<typename... Output>
using Func = void(Output*...);
=============================================================



Compiling the attached test case with 'clang++ --std=c++11 a.cc' (or indeed
c++1y) results in the following error message:

=============================================================
a.cc:21:3: error: no matching function for call to 'run_func'
  run_func(f, &value);
  ^~~~~~~~
a.cc:9:6: note: candidate template ignored: deduced conflicting types for
      parameter 'Output' ('double' vs. <double>)
void run_func(Func<Output...>& func, Output*... output) {
     ^
=============================================================


Using the function type directly, however, compiles as expected. That is
replacing the signature of run_func with:


=============================================================
template<typename... Output>
void run_func(void (&func)(Output*...), Output*... output) {
=============================================================

-- 
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/20140520/7c18591a/attachment.html>


More information about the llvm-bugs mailing list