From 0c2ecfd4a29161d6c2bd3a83335387f42ff38ffe Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Wed, 22 Nov 2023 20:57:59 +0100 Subject: 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. --- gcc/fortran/options.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/options.cc') diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc index b788521..02a29f8 100644 --- a/gcc/fortran/options.cc +++ b/gcc/fortran/options.cc @@ -57,8 +57,10 @@ set_default_std_flags (void) gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY - | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS | GFC_STD_F2023; - gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY; + | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS | GFC_STD_F2023 + | GFC_STD_F2023_DEL; + gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY + | GFC_STD_F2023_DEL; } /* Set (or unset) the DEC extension flags. */ -- cgit v1.1