On Mon, Jul 13, 2026 at 04:34:12PM -0400, Jason Merrill wrote:
> > So far tested with
> > GXX_TESTSUITE_STDS=98,11,14,17,20,23,26,29 make -j32 -k check-g++
> > make -j32 check-target-libstdc++-v3
> >
> > Ok for trunk if it passes full bootstrap/regtest?
>
> Does this affect mangling?
I've tried to compile
struct A {};
void operator delete (void *, A) {}
struct B {};
void operator delete (void *, B) {}
struct C {
static void operator delete (void *);
};
void C::operator delete (void *) {}
struct D {};
void operator delete (void *, D) noexcept (true) {}
template <bool B>
struct E {
template <typename T>
static void operator delete (void *, T) noexcept (B) {}
};
auto f1 () { return &E <true>::operator delete<int>; }
auto f2 () { return &E <false>::operator delete<int>; }
with g++ 15, vanilla trunk and patched trunk and everything is identical
except .ident, mangled names
_ZdlPv1A
_ZdlPv1B
_ZN1CdlEPv
_ZdlPv1D
_Z2f1v
_Z2f2v
_ZN1EILb1EEdlIiEEvPvT_
_ZN1EILb0EEdlIiEEvPvT_
If I add
template <typename T>
void bar () {}
void baz () { bar <decltype (C::operator delete)> (); }
to that testcase, then there is a difference, _Z3barIFvPvEEvv
vs. _Z3barIDoFvPvEEvv. Isn't that desirable though?
Note, clang++ mangles it the same as the patched g++, it is unlikely
anybody does this in real-world code and they do actually want to
test in that case whether it is explicitly or implicitly noexcept or not.
Like when one uses reflection and tests is_noexcept, or uses noexcept
on the destroying delete.
Jakub