https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108795
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:426cab4e3b46abaeae0813042b5addc789e3b2be commit r13-6802-g426cab4e3b46abaeae0813042b5addc789e3b2be Author: Jason Merrill <ja...@redhat.com> Date: Tue Mar 21 15:15:27 2023 -0400 c++: attribute on dtor in template [PR108795] Since r7-2549 we were throwing away the explicit C:: when we found that ~C has an attribute that we treat as making its type dependent. PR c++/108795 gcc/cp/ChangeLog: * semantics.cc (finish_id_expression_1): Check scope before returning id_expression. gcc/testsuite/ChangeLog: * g++.dg/ext/attr-tsafe1.C: New test.