https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124241
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:822c7840922d957fede19e6f11d94160772cd454 commit r17-316-g822c7840922d957fede19e6f11d94160772cd454 Author: [email protected] <[email protected]> Date: Mon May 4 21:22:53 2026 +0800 c++/reflection: fix ICE on is_accessible [PR124241] Anonymous unions don't have their own access. This patch fix the missing check for otype in accessible_p at search.cc. gcc/cp/ChangeLog: PR c++/124241 * search.cc (accessible_p): Call type_context_for_name_lookup for otype if it's anonymous union. gcc/testsuite/ChangeLog: PR c++/124241 * g++.dg/reflect/is_accessible2.C: Completed the TODO of the PR. Reviewed-by: Jason Merrill <[email protected]>
