[Bug c++/123913] [reflection] Internal Compiler Error in eval_is_function_parameter at cp/reflect.cc:1656 materializing function type parameters
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 4 11:31:31 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123913
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:8bc8aaed6c22fac5f66be11e92001665c20716ef
commit r16-7281-g8bc8aaed6c22fac5f66be11e92001665c20716ef
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Feb 4 12:30:42 2026 +0100
c++: Fix up eval_parameters_of for function types [PR123913]
eval_parameters_of was trying to share 3 lines of code between the
function declaration and function type cases, but got it wrong in
multiple ways for the latter. One thing is that we should override
reflect_kind only for the function decl case to REFLECT_PARM, there
we need to differentiate function parameter reflection vs. variable
reflection, for function type it is just type. Another one is that
we iterate over PARM_DECLs through DECL_CHAIN in the function decl
case, but for types we iterate over the TREE_LIST nodes and the
type is only TREE_VALUE of that.
And last, but am not sure about that, maybe
https://eel.is/c++draft/meta.reflection#queries-62.2 should be clarified,
I think we want to apply dealias. We have notes like
https://eel.is/c++draft/meta.reflection#queries-note-7
https://eel.is/c++draft/meta.reflection#traits-5
but those don't apply to type_of or parameters_of. And I think there was
an agreement that meta fns which return reflection of a type don't return
type aliases, but can't see it written explicitly except for the traits.
2026-02-04 Jakub Jelinek <jakub@redhat.com>
PR c++/123913
PR c++/123964
* reflect.cc (eval_parameters_of): Fix up handling of function
types.
* g++.dg/reflect/parameters_of7.C: New test.
More information about the Gcc-bugs
mailing list