Skip to content

[bisected] Templating issues with Clang++ 20.1.0 #131520

@FireBurn

Description

@FireBurn

I'm seeing templating errors being generated with compiling with Clang++ 20 that I don't see with GCC g++ or using Clang++ 19

externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2159:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<16UL, false>' requested here
 2159 |     EmitFPVectorToFixed<16, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2159:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<16UL, false>' requested here
 2159 |     EmitFPVectorToFixed<16, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:16:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2163:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<32UL, false>' requested here
 2163 |     EmitFPVectorToFixed<32, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2163:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<32UL, false>' requested here
 2163 |     EmitFPVectorToFixed<32, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:16:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2167:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<64UL, false>' requested here
 2167 |     EmitFPVectorToFixed<64, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2167:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<64UL, false>' requested here
 2167 |     EmitFPVectorToFixed<64, false>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:16:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2171:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<16UL, true>' requested here
 2171 |     EmitFPVectorToFixed<16, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2171:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<16UL, true>' requested here
 2171 |     EmitFPVectorToFixed<16, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:16:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2175:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<32UL, true>' requested here
 2175 |     EmitFPVectorToFixed<32, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2175:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<32UL, true>' requested here
 2175 |     EmitFPVectorToFixed<32, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:16:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:27:1: error: implicit instantiation of undefined template 'mcl::mp::detail::lift_sequence_impl<std::integer_sequence<unsigned long, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64>>'
   27 | using lift_sequence = typename detail::lift_sequence_impl<VL>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2130:28: note: in instantiation of template type alias 'lift_sequence' requested here
 2130 |     using fbits_list = mp::lift_sequence<std::make_index_sequence<fsize + 1>>;
      |                            ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2179:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<64UL, true>' requested here
 2179 |     EmitFPVectorToFixed<64, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/lift_sequence.hpp:16:8: note: template is declared here
   16 | struct lift_sequence_impl;
      |        ^
In file included from externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:14:
In file included from externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:8:
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:23:1: error: implicit instantiation of undefined template 'mcl::mp::detail::map_impl<mcl::mp::list, int>'
   23 | using map = typename detail::map_impl<F, L>::type;
      | ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/typelist/cartesian_product.hpp:45:1: note: in instantiation of template type alias 'map' requested here
   45 | using cartesian_product = typename detail::cartesian_product_impl<map<list, L1>, Ls...>::type;
      | ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2153:13: note: in instantiation of template type alias 'cartesian_product' requested here
 2153 |         mp::cartesian_product<fbits_list, rounding_list>{});
      |             ^
externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp:2179:5: note: in instantiation of function template specialization 'Dynarmic::Backend::X64::EmitFPVectorToFixed<64UL, true>' requested here
 2179 |     EmitFPVectorToFixed<64, true>(code, ctx, inst);
      |     ^
externals/dynarmic/externals/mcl/src/../include/mcl/mp/metafunction/map.hpp:12:8: note: template is declared here
   12 | struct map_impl;
      |        ^
12 errors generated.

I bisected this back to:

28ad8978ee2054298d4198bf10c8cb68730af037 is the first bad commit
commit 28ad8978ee2054298d4198bf10c8cb68730af037
Author: Matheus Izvekov <[email protected]>
Date:   Thu Jan 23 20:37:33 2025 -0300

    Reland: [clang] unified CWG2398 and P0522 changes; finishes implementation of P3310 (#124137)
    
    This patch relands the following PRs:
    * #111711
    * #107350
    * #111457
    
    All of these patches were reverted due to an issue reported in
    https://github.com/llvm/llvm-project/pull/111711#issuecomment-2406491485,
    due to interdependencies.

There was a potential fix #130950 but this didn't fix the issues I was seeing

I'm attaching a reproducer:

emit_x64_vector_floating_point-57a13e.zip

Thanks for letting me know about -gen-reproducer all my googling had led me to llc test reducers

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