Skip to content

error: implicit instantiation of undefined template #131511

@oltolm

Description

@oltolm

This is a regression in Clang 20. It didn't happen in Clang 19 and it does not happen with other compilers.

#include <utility>

namespace mcl::mp {

template <class... E> struct list {};

} // namespace mcl::mp

#include <type_traits>

namespace mcl::mp {

namespace detail {

template <class VL> struct lift_sequence_impl;

template <class T, template <class, T...> class VLT, T... values>
struct lift_sequence_impl<VLT<T, values...>> {
    using type = list<std::integral_constant<T, values>...>;
};

} // namespace detail

template <class VL>
using lift_sequence = typename detail::lift_sequence_impl<VL>::type;

} // namespace mcl::mp

int wmain(int argc, wchar_t** argv)
{
    using fbits_list = mcl::mp::lift_sequence<std::make_index_sequence<1>>;
    return 0;
}
<source>:25:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0>>'
   25 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
<source>:31:33: note: in instantiation of template type alias 'lift_sequence' requested here
   31 |     using fbits_list = mcl::mp::lift_sequence<std::make_index_sequence<1>>;
      |                                 ^
<source>:15:28: note: template is declared here
   15 | template <class VL> struct lift_sequence_impl;
      |                            ^
1 error generated.
Compiler returned: 1

https://godbolt.org/z/hGfMf8MzP

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions