https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124790
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:90555b05465dff636e258e0fe9184feb5b949e0a commit r16-8500-g90555b05465dff636e258e0fe9184feb5b949e0a Author: Jakub Jelinek <[email protected]> Date: Tue Apr 7 17:59:13 2026 +0200 c++: Mark reflected vars/parameters as read [PR124790] This PR complains about spurious -Wunused-but-set-* warnings when using reflections. E.g. there is no warning for variable just set and used in sizeof (var), but there is one when using size_of (^^var). If we reflect some variable or parameter, we can do all kinds of things with it, so setting preventing these warnings is IMHO desirable. 2026-04-07 Jakub Jelinek <[email protected]> PR c++/124790 * reflect.cc (get_reflection): When reflecting VAR_DECL or PARM_DECL, call mark_exp_read on it. * g++.dg/reflect/pr124790.C: New test. Reviewed-by: Jason Merrill <[email protected]>
