https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108795
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:1c1a9a0b60a9a182bcff79084e5ac367a6329bc2 commit r12-9463-g1c1a9a0b60a9a182bcff79084e5ac367a6329bc2 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.