[llvm-bugs] [Bug 52586] New: Failure to partially specialize a class when make_index_sequence is involved

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 22 12:02:44 PST 2021


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

            Bug ID: 52586
           Summary: Failure to partially specialize a class when
                    make_index_sequence is involved
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vejnar.martin 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

The following code fails to compile.

    #include <utility>

    template <typename T, typename Seq>
    struct X;

    template <typename T>
    struct X<T, std::make_index_sequence<sizeof(T)>> {
    };

    X<char, std::make_index_sequence<1>> x;
    // ^^^
    // error: implicit instantiation of undefined template
    // 'X<char, std::integer_sequence<unsigned long, 0>>

See https://godbolt.org/z/o8ejrTGKE

Replacing make_index_sequence<1> with the equivalent index_sequence<0> in the
class template definition works around the issue.

-- 
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/20211122/04706cd6/attachment.html>


More information about the llvm-bugs mailing list