[llvm-bugs] [Bug 40302] New: Fails to deduce template type for repeated argument of the same type

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 13 20:29:58 PST 2019


            Bug ID: 40302
           Summary: Fails to deduce template type for repeated argument of
                    the same type
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.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 21318
  --> https://bugs.llvm.org/attachment.cgi?id=21318&action=edit

The attached testcase passes several lambda functions of the same type to the
function 'test'. clang fails to use the single template type for all arguments.
It succeeds only when the same type is listed several times, once per argument.

test.cpp:11:3: error: no matching function for call to 'test'
test.cpp:4:13: note: candidate template ignored: deduced conflicting types for
parameter 'Fn' ('(lambda at test.cpp:12:5)' vs. '(lambda at test.cpp:12:30)')
static void test(Fn &&fn1, Fn &&fn2, Fn &&fn3) { }
1 error generated.

Please note that '(lambda at test.cpp:12:5)' and '(lambda at test.cpp:12:30)'
are of the same type.

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/20190114/c0cdd531/attachment.html>

More information about the llvm-bugs mailing list