https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110809

            Bug ID: 110809
           Summary: ICE: in unify, at cp/pt.cc:25226 with floating-point
                    NTTPs
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

#include <boost/hana.hpp>
using A = double;
template<A> struct S {};
auto x = boost::hana::make_map(
    boost::hana::make_pair(boost::hana::type_c<S<A(1)>>, 1),
    boost::hana::make_pair(boost::hana::type_c<S<A(2)>>, 2))[
        boost::hana::type_c<S<A(1)>>];

/opt/compiler-explorer/libs/boost_1_82_0/boost/hana/detail/hash_table.hpp:51:62:
internal compiler error: in unify, at cp/pt.cc:25226
   51 |         using type =
decltype(detail::find_indices_impl<Hash>(std::declval<Map>()));
      |                              
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
0x246af2e internal_error(char const*, ...)
        ???:0
0xac8ab6 fancy_abort(char const*, int, char const*)
        ???:0
0xd01e11 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ???:0
0xaf7db9 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0xd2379c finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0xcddfef tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xcde6fc tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd06d50 instantiate_class_template(tree_node*)
        ???:0
0xd5954f complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ???:0
0xcdf1a7 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xcde6fc tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd06d50 instantiate_class_template(tree_node*)
        ???:0
0xd5954f complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ???:0
0xcdf1a7 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xcde6fc tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xcd6618 instantiate_decl(tree_node*, bool, bool)
        ???:0
0xbb8461 maybe_instantiate_decl(tree_node*)
        ???:0
0xbb9ebf mark_used(tree_node*, int)
        ???:0
0xaf673e build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ???:0
0xd22eaf finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0

Changing `A` to `int` makes it compile, so this is a problem with
floating-point NTTPs.

Reply via email to