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

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
> The Bloomberg clang++ branch mangles these as
> _Z3fooIMn$EEvv
> _Z3fooIMnNSt3__14metaE$EEvv
> _Z3fooIMvLi42EEEvv
> where using $ in the mangled names is certainly wrong.
> GCC mangles it as
> _Z3fooIXL_Z2::EEEvv
> _Z3fooIXL_ZSt4metaEEEvv
> _Z3fooIXLi42EEEvv
> which is obviously wrong too, :: in a mangled name can't appear, and
> reflect_constant (42) argument shouldn't be mangled as a merge 42 constant
> IMHO.

Regarding mangling, we really need some agreed on mangling for the constants
with std::meta::info type.
Because
#include <meta>

template <auto A>
void
foo ()
{
}

int v;

void
bar ()
{
  foo <42> ();
  foo <std::meta::reflect_constant (42)> ();
  foo <^^::> ();
  foo <std::meta::info {}> ();
  foo <^^int> ();
  foo <^^v> ();
}
is I think all valid and needs to mangle differently each time.  And it needs
to be a mangling that mangles the reflections which compare equal the same and
those which compare differently using different strings.

Reply via email to