diff options
author | Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt> | 2025-10-03 01:56:52 +0100 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-10-03 18:57:18 +0100 |
commit | 806d5417e0c04a15c48a7e876ebf435f06ecfccc (patch) | |
tree | 8c76d9668227a6d67d33253bb24563059059c4d4 /gcc/testsuite/gcc.dg/tree-ssa | |
parent | 8cd2db265e73c55f20c05bddf23d3e0165488b2c (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
When parsing function parameters containing a struct declaration,
initially auto_is_implicit_function_template_parm_p is set to true by
cp_parser_parameter_declaration_clause. However, later when we enter
class scope and scope_kind becomes sk_class, we don't set it to false, so
cp_parser_simple_type_specifier will call
synthesize_implicit_template_parm, which expects that
current_binding_level->kind == sk_function_parms, triggering a failed
assertion. This fix ensures that auto_is_implicit_function_template_parm_p
isn't set when parsing a struct body definition.
gcc/cp/ChangeLog:
PR c++/122112
* parser.cc (cp_parser_parameter_declaration_clause): Don't
enable auto_is_implicit_function_template_parm_p when entering
class scope.
gcc/testsuite/ChangeLog:
PR c++/122112
* g++.dg/parse/auto-struct-param.C: New test.
Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa')
0 files changed, 0 insertions, 0 deletions