https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106839
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- As noted in PR 106838 the library needs to guard use of __has_virtual_destructor so it's only used with non-union class types. This applies to trunk as well.