Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Failure to partially specialize a class when make_index_sequence is involved #51553

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR52586
Status NEW
Importance P normal
Reported by Martin Vejnár (vejnar.martin@gmail.com)
Reported on 2021-11-22 12:02:44 -0800
Last modified on 2021-11-22 12:02:44 -0800
Version trunk
Hardware All All
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
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.