[Bug c++/123934] [reflection] bug in member function type comparison
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 5 14:17:23 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123934
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:507ea25cf2e18bba38e28ab7b57cc725895cb067
commit r16-7330-g507ea25cf2e18bba38e28ab7b57cc725895cb067
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Feb 4 11:31:02 2026 -0500
c++/reflection: fix type_of for member fns [PR123934]
Here the assert was wrongly failing with
'void (struct F::)(int)' is not the same as 'void(int)'
but as per [dcl.fct]/1 the type of fType should not include the class F.
PR c++/123934
gcc/cp/ChangeLog:
* reflect.cc (type_of): For FUNCTION_DECLs, use static_fn_type.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/type_of2.C: Uncomment an assert.
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list