diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-03-28 08:57:11 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-03-28 08:57:11 -0400 |
commit | 7981c06ae92548bd66f07121db1802eb6aec73ed (patch) | |
tree | c5c9ddcf1dd284be44597236b30a683b91ba4ddd /gcc/fortran/decl.c | |
parent | a7ea3d2ced786c4544fa625f34f515d89ed074fe (diff) | |
download | gcc-7981c06ae92548bd66f07121db1802eb6aec73ed.zip gcc-7981c06ae92548bd66f07121db1802eb6aec73ed.tar.gz gcc-7981c06ae92548bd66f07121db1802eb6aec73ed.tar.bz2 |
c++: Diagnose when "requires" is used instead of "requires requires" [PR94306]
This adds support to detect and recover from the case where an opening brace
immediately follows the start of a requires-clause. So rather than emitting the
error
error: expected primary-expression before '{' token
followed by a slew of irrevelant errors, we now assume the user had intended to
write "requires requires {" and diagnose and recover accordingly.
gcc/cp/ChangeLog:
PR c++/94306
* parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
"requires {" when "requires requires {" was probably intended.
gcc/testsuite/ChangeLog:
PR c++/94306
* g++.dg/concepts/diagnostic8.C: New test.
Diffstat (limited to 'gcc/fortran/decl.c')
0 files changed, 0 insertions, 0 deletions