[llvm-bugs] [Bug 42757] New: Template deduction fails with defaulted argument that's an index_sequence

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 25 11:30:27 PDT 2019


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

            Bug ID: 42757
           Summary: Template deduction fails with defaulted argument
                    that's an index_sequence
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin 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

Reduced from StackOverflow (https://stackoverflow.com/q/57206006/2069064):

#include <utility>
#include <cstdint>

template <std::size_t S, class=std::make_index_sequence<S>>
struct FooList;
template <std::size_t S, std::size_t... Idxs>
struct FooList<S, std::integer_sequence<std::size_t, Idxs...>> { };

template <std::size_t S>
void foobar(FooList<S>) { }

void test() { 
  foobar(FooList<5>{});
}

This fails to compile on clang, the candidate is rejected with the note:

candidate template ignored: could not match '__make_integer_seq' against
'integer_sequence'

Even though these are the same type. This compiles on gcc.

-- 
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/20190725/92c694c6/attachment.html>


More information about the llvm-bugs mailing list