https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124756
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Marek Polacek <[email protected]>: https://gcc.gnu.org/g:f2edcf0590c3cecbce3899eceac155c1659adbbb commit r16-8850-gf2edcf0590c3cecbce3899eceac155c1659adbbb Author: Marek Polacek <[email protected]> Date: Fri Apr 24 17:30:43 2026 -0400 c++/reflection: disallow reflecting block-scope externs (CWG 3065) [PR124756] The proposed resolution of CWG 3065 suggests that reflection on a block-scope extern declaration be ill-formed. This patch makes it so, and it also happens to fix a crash. PR c++/124756 gcc/cp/ChangeLog: * reflect.cc (get_reflection): Give an error when taking the reflection of a block-scope extern. gcc/testsuite/ChangeLog: * g++.dg/reflect/identifier_of3.C: Add dg-error. * g++.dg/reflect/pr123612.C: Likewise. * g++.dg/reflect/error13.C: New test. Reviewed-by: Jason Merrill <[email protected]> (cherry picked from commit c1977d101524d87642790422134fe170ce00b545)
