https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113612
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:ef7738d2d0ee0103946e5243aa7e5c8ad2fb0c6d commit r13-8324-gef7738d2d0ee0103946e5243aa7e5c8ad2fb0c6d Author: Jason Merrill <ja...@redhat.com> Date: Mon Feb 12 21:00:53 2024 -0500 c++: variable partial spec redeclaration [PR113612] If register_specialization finds a previous declaration and throws the new one away, we shouldn't still add the new one to DECL_TEMPLATE_SPECIALIZATIONS. PR c++/113612 gcc/cp/ChangeLog: * pt.cc (process_partial_specialization): Return early on redeclaration. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/var-templ85.C: New test. (cherry picked from commit 19ac327de421fe05916e234e3450e6e1cc5c935c)