diff options
author | Jason Merrill <jason@redhat.com> | 2021-10-18 16:12:15 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-10-20 17:40:13 -0400 |
commit | 1c690164668bda556f308632eab4204f63a138d7 (patch) | |
tree | 55116db17696800765568f71ab396b90498378ce /gcc/fortran/parse.c | |
parent | 788483f77de04515b0b72d3c4c841c37b005f404 (diff) | |
download | gcc-1c690164668bda556f308632eab4204f63a138d7.zip gcc-1c690164668bda556f308632eab4204f63a138d7.tar.gz gcc-1c690164668bda556f308632eab4204f63a138d7.tar.bz2 |
c++: tweak parsing of invalid types
cp_parser_parse_and_diagnose_invalid_type_name is called during declaration
parsing, so it should pass 'true' for the declarator_p argument. But that
caused a diagnostic regression on template/pr84789.C due to undesired lookup
in dependent scopes. To fix that, cp_parser_nested_name_specifier_opt needs
to respect the value of check_dependency_p.
This patch avoids a regression from Andrew Sharp's WIP patch for PR70417.
It would make more sense to test only check_dependency_p, not declarator_p,
but removing the declarator_p condition turns out to reveal complicated
interactions of cp_parser_constructor_declarator_p and caching of
nested-name-specifiers and template-ids that I've already spent too much
time trying to sort out.
gcc/cp/ChangeLog:
* parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
Pass true for declarator_p.
(cp_parser_nested_name_specifier_opt): Only look through
TYPENAME_TYPE if check_dependency_p is false.
Diffstat (limited to 'gcc/fortran/parse.c')
0 files changed, 0 insertions, 0 deletions