LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 52586 - Failure to partially specialize a class when make_index_sequence is involved
Summary: Failure to partially specialize a class when make_index_sequence is involved
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-22 12:02 PST by Martin Vejnár
Modified: 2021-11-22 12:02 PST (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Vejnár 2021-11-22 12:02:44 PST
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.