diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-10-08 10:49:27 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-10-08 12:49:27 +0200 |
commit | 8beaf167f7ca723101e87da432870b65ff521e99 (patch) | |
tree | 0cdde010d1a0ab9f25491e6c335f5b44ee220020 /gcc/fortran/openmp.c | |
parent | db4fd465197346f0023dc7821ba14da6987042c7 (diff) | |
download | gcc-8beaf167f7ca723101e87da432870b65ff521e99.zip gcc-8beaf167f7ca723101e87da432870b65ff521e99.tar.gz gcc-8beaf167f7ca723101e87da432870b65ff521e99.tar.bz2 |
Fortran - Improve OpenMP/OpenACC diagnostic
gcc/fortran/
* match.h (gfc_match_omp_eos_error): Renamed from gfc_match_omp_eos.
* openmp.c (gfc_match_omp_eos): Make static.
(gfc_match_omp_eos_error): New.
* parse.c (matchs, matchdo, matchds): Do as done for 'matcho' -
if error occurred after OpenMP/OpenACC directive matched, do not
try other directives.
(decode_oacc_directive, decode_omp_directive): Call new function
instead.
testsuite/
* gfortran.dg/goacc/continuation-free-form.f95: Update dg-error.
From-SVN: r276694
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 7df7384..cd28384 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see /* Match an end of OpenMP directive. End of OpenMP directive is optional whitespace, followed by '\n' or comment '!'. */ -match +static match gfc_match_omp_eos (void) { locus old_loc; @@ -57,6 +57,17 @@ gfc_match_omp_eos (void) return MATCH_NO; } +match +gfc_match_omp_eos_error (void) +{ + if (gfc_match_omp_eos() == MATCH_YES) + return MATCH_YES; + + gfc_error ("Unexpected junk at %C"); + return MATCH_ERROR; +} + + /* Free an omp_clauses structure. */ void |