]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/fortran/primary.cc
Fortran: detect blanks within literal constants in free-form mode [PR92805]
authorHarald Anlauf <anlauf@gmx.de>
Thu, 28 Jul 2022 20:07:02 +0000 (22:07 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sun, 31 Jul 2022 18:43:17 +0000 (20:43 +0200)
commitd325e7048c85e13f12ea79aebf9623eddc7ffcaf
tree26f8ad6d7eab9e87f0feaa4767e672969e0b10f5
parent0110cfd5449bae3a772f45ea2e4c5dab5b7a8ccd
Fortran: detect blanks within literal constants in free-form mode [PR92805]

gcc/fortran/ChangeLog:

PR fortran/92805
* match.cc (gfc_match_small_literal_int): Make gobbling of leading
whitespace optional.
(gfc_match_name): Likewise.
(gfc_match_char): Likewise.
* match.h (gfc_match_small_literal_int): Adjust prototype.
(gfc_match_name): Likewise.
(gfc_match_char): Likewise.
* primary.cc (match_kind_param): Match small literal int or name
without gobbling whitespace.
(get_kind): Do not skip over blanks.
(match_string_constant): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/92805
* gfortran.dg/literal_constants.f: New test.
* gfortran.dg/literal_constants.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
gcc/fortran/match.cc
gcc/fortran/match.h
gcc/fortran/primary.cc
gcc/testsuite/gfortran.dg/literal_constants.f [new file with mode: 0644]
gcc/testsuite/gfortran.dg/literal_constants.f90 [new file with mode: 0644]