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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-05-25
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Even worse, ^^A::operator int compares equal to ^^A::operator long, guess it
mangles the same, etc.

#include <meta>

struct A {
  template <typename T> operator T () { return T (); }
};

static_assert (^^A::operator int != ^^A::operator long);
static_assert (is_conversion_function (^^A::operator int));
static_assert (!is_conversion_function_template (^^A::operator int));

Seems the int vs. long here is encoded in BASELINK_OPTYPE, but we happily look
through in BASELINKs in compare_reflections and many other reflect.cc
functions.
Dunno what normally turns these BASELINKs with BASELINK_OPTYPE into
TEMPLATE_ID_EXPR of the TEMPLATE_DECL with arguments, but supposedly that
should be done when parsing the ^^ id-expression , or we'll need to handle this
everywhere.

Reply via email to