diff options
author | Harald Anlauf <anlauf@gmx.de> | 2023-11-22 20:57:59 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2023-11-23 19:07:16 +0100 |
commit | 0c2ecfd4a29161d6c2bd3a83335387f42ff38ffe (patch) | |
tree | e04460cb03cb356038a46fe6b45bc83f670fc88e /gcc/fortran/libgfortran.h | |
parent | 9a3c40af7f7dd218cc2ebaa3a70f3317f7316ceb (diff) | |
download | gcc-0c2ecfd4a29161d6c2bd3a83335387f42ff38ffe.zip gcc-0c2ecfd4a29161d6c2bd3a83335387f42ff38ffe.tar.gz gcc-0c2ecfd4a29161d6c2bd3a83335387f42ff38ffe.tar.bz2 |
Fortran: restrictions on integer arguments to SYSTEM_CLOCK [PR112609]
Fortran 2023 added restrictions on integer arguments to SYSTEM_CLOCK to
have a decimal exponent range at least as large as a default integer,
and that all integer arguments have the same kind type parameter.
gcc/fortran/ChangeLog:
PR fortran/112609
* check.cc (gfc_check_system_clock): Add checks on integer arguments
to SYSTEM_CLOCK specific to F2023.
* error.cc (notify_std_msg): Adjust to handle new features added
in F2023.
* gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023_DEL,
remove obsolete option GFC_STD_F2008_TS and fix enumeration values.
* libgfortran.h (GFC_STD_F2023_DEL): Add and use in GFC_STD_OPT_F23.
* options.cc (set_default_std_flags): Add GFC_STD_F2023_DEL.
gcc/testsuite/ChangeLog:
PR fortran/112609
* gfortran.dg/system_clock_1.f90: Add option -std=f2003.
* gfortran.dg/system_clock_3.f08: Add option -std=f2008.
* gfortran.dg/system_clock_4.f90: New test.
Diffstat (limited to 'gcc/fortran/libgfortran.h')
-rw-r--r-- | gcc/fortran/libgfortran.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h index bdddb31..2c71b90 100644 --- a/gcc/fortran/libgfortran.h +++ b/gcc/fortran/libgfortran.h @@ -20,8 +20,10 @@ along with GCC; see the file COPYING3. If not see /* Flags to specify which standard/extension contains a feature. Note that no features were obsoleted nor deleted in F2003 nor in F2023. + Nevertheless, some features available in F2018 are prohibited in F2023. Please remember to keep those definitions in sync with gfortran.texi. */ +#define GFC_STD_F2023_DEL (1<<13) /* Prohibited in F2023. */ #define GFC_STD_F2023 (1<<12) /* New in F2023. */ #define GFC_STD_F2018_DEL (1<<11) /* Deleted in F2018. */ #define GFC_STD_F2018_OBS (1<<10) /* Obsolescent in F2018. */ @@ -41,12 +43,13 @@ along with GCC; see the file COPYING3. If not see * are allowed with a certain -std option. */ #define GFC_STD_OPT_F95 (GFC_STD_F77 | GFC_STD_F95 | GFC_STD_F95_OBS \ | GFC_STD_F2008_OBS | GFC_STD_F2018_OBS \ - | GFC_STD_F2018_DEL) + | GFC_STD_F2018_DEL | GFC_STD_F2023_DEL) #define GFC_STD_OPT_F03 (GFC_STD_OPT_F95 | GFC_STD_F2003) #define GFC_STD_OPT_F08 (GFC_STD_OPT_F03 | GFC_STD_F2008) #define GFC_STD_OPT_F18 ((GFC_STD_OPT_F08 | GFC_STD_F2018) \ & (~GFC_STD_F2018_DEL)) -#define GFC_STD_OPT_F23 (GFC_STD_OPT_F18 | GFC_STD_F2023) +#define GFC_STD_OPT_F23 ((GFC_STD_OPT_F18 | GFC_STD_F2023) \ + & (~GFC_STD_F2023_DEL)) /* Bitmasks for the various FPE that can be enabled. These need to be straight integers e.g., 8 instead of (1<<3), because they will be included in Fortran source. */ |