Skip to content

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

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 52586
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions