https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105306
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Reduced test-case: $ cat semantic.C #pragma GCC optimize 0 template <typename T> void foo(T); struct B { ~B() {} }; struct C { B f; }; template <typename> struct E { void bar() { foo(g); } C g; }; template class E<char>; $ g++ semantic.C -c -Ofast semantic.C:13:23: error: semantic interposition mismatch 13 | template class E<char>; | ^ _ZN1BD1Ev/2 (B::~B()) @0x7ffff778e220 Type: function definition analyzed alias cpp_implicit_alias Visibility: externally_visible public weak comdat comdat_group:_ZN1BD5Ev one_only Same comdat group as: _ZN1BD2Ev/1 References: _ZN1BD2Ev/1 (alias) Referring: Availability: available Function flags: Called by: _ZN1CD2Ev/5 Calls: during IPA pass: visibility