[Bug fortran/57553] [F08] Valid use of STORAGE_SIZE rejected, bad error message for invalid use
anlauf at gmx dot de
gcc-bugzilla@gcc.gnu.org
Fri Feb 12 23:29:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57553
--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Harald Anlauf from comment #5)
I think I mixed up gfc_option.warn_std and gfc_option.allow_std
in the previous patch. A revised version follows:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 233388)
+++ gcc/fortran/expr.c (working copy)
@@ -2264,6 +2264,15 @@
"new_line", NULL
};
+ /* std=f2008+ or -std=gnu */
+ static const char *const inquiry_func_gnu[] = {
+ "lbound", "shape", "size", "ubound",
+ "bit_size", "len", "kind",
+ "digits", "epsilon", "huge", "maxexponent", "minexponent",
+ "precision", "radix", "range", "tiny",
+ "new_line", "storage_size", NULL
+ };
+
int i = 0;
gfc_actual_arglist *ap;
@@ -2290,8 +2299,11 @@
{
name = e->symtree->n.sym->name;
- functions = (gfc_option.warn_std & GFC_STD_F2003)
+ /* Choose appropriate set. Note that -std=gnu is std=f2008+ */
+ functions = (gfc_option.allow_std & GFC_STD_F2003)
? inquiry_func_f2003 : inquiry_func_f95;
+ functions = (gfc_option.allow_std & GFC_STD_F2008)
+ ? inquiry_func_gnu : functions;
for (i = 0; functions[i]; i++)
if (strcmp (functions[i], name) == 0)
More information about the Gcc-bugs
mailing list