[Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 27 19:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85088
--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #4)
> It seems that there is some inconsistencies
Right, in particular regarding INTENT_INOUT vs DECL_INOUT etc. Therefore the
patch in comment #2 is much too naive (and produces a huge amount of
regressions).
However, the following works well (and is free of regressions):
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 258893)
+++ gcc/fortran/decl.c (working copy)
@@ -4811,6 +4811,8 @@ match_attr_spec (void)
d = DECL_IN;
else if (gfc_match (" ( out )") == MATCH_YES)
d = DECL_OUT;
+ else
+ gfc_error ("Bad INTENT specification at %C");
}
}
else if (ch == 'r')
With this ones gets the following:
c0.f90:2:18:
integer, intent(int) :: x
1
Error: Bad INTENT specification at (1)
c0.f90:3:18:
integer, intent :: y
1
Error: Bad INTENT specification at (1)
c0.f90:4:11:
integer, inten :: z
1
Error: Invalid character in name at (1)
More information about the Gcc-bugs
mailing list