+2020-01-16 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93253
+ * check.c (gfc_invalid_boz): Mention -fallow-invalid-boz
+ in the error message.
+ * gfortran.texi (BOZ literal constants): List another missing
+ extension and refer to -fallow-invalid-boz.
+ * lang.opt (fallow-invalid-boz): Also mention 'X' in the help text
+ as it is not covered by the previous wording.
+ * primary.c (match_boz_constant): Tweak wording such that it is
+ clear how to fix the nonstandard use.
+
2020-01-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/65428
return false;
}
- gfc_error (msg, loc);
+ const char hint[] = " [see %<-fno-allow-invalid-boz%>]";
+ size_t len = strlen (msg) + strlen (hint) + 1;
+ char *msg2 = (char *) alloca (len);
+ strcpy (msg2, msg);
+ strcat (msg2, hint);
+ gfc_error (msg2, loc);
return true;
}
dependent. Gfortran interprets the sign bit as a user would expect.
As a deprecated extension, GNU Fortran allows hexadecimal BOZ literal
-constants to be specified using the @code{X} prefix. The BOZ literal
+constants to be specified using the @code{X} prefix. That the BOZ literal
constant can also be specified by adding a suffix to the string, for
-example, @code{Z'ABC'} and @code{'ABC'X} are equivalent.
+example, @code{Z'ABC'} and @code{'ABC'X} are equivalent. Additionally,
+as extension, BOZ literals are permitted in some contexts outside of
+@code{DATA} and the intrinsic functions listed in the Fortran standard.
+Use @option{-fallow-invalid-boz} to enable the extension.
@node Real array indices
@subsection Real array indices
fallow-invalid-boz
Fortran RejectNegative Var(flag_allow_invalid_boz)
-Allow a BOZ literal constant to appear in an invalid context.
+Allow a BOZ literal constant to appear in an invalid context and with X instead of Z.
fallow-leading-underscore
Fortran Undocumented Var(flag_allow_leading_underscore)
if (x_hex
&& gfc_invalid_boz ("Hexadecimal constant at %L uses "
- "nonstandard syntax", &gfc_current_locus))
+ "nonstandard X instead of Z", &gfc_current_locus))
return MATCH_ERROR;
old_loc = gfc_current_locus;
+2020-01-16 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93253
+ * fortran.dg/boz_7.f90: Updated dg-error.
+
2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/91073
!
integer :: k, m
integer :: j = z'000abc' ! { dg-error "BOZ used outside a DATA statement" }
-data k/x'0003'/ ! { dg-error "nonstandard syntax" }
+data k/x'0003'/ ! { dg-error "nonstandard X instead of Z" }
data m/'0003'z/ ! { dg-error "nonstandard postfix" }
end