Commit c7e34433 by Steven G. Kargl

re PR fortran/90988 (Wrong error message with variables named "PUBLIC*")

2019-11-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90988
	* decl.c (gfc_match_private, gfc_match_public): Fixed-form source code
	does not require whitespace between PRIVATE (or PUBLIC) and an entity.

2019-11-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90988
	* gfortran.dg/pr90988_4.f: New test.

From-SVN: r277714
parent 783aea33
2019-11-01 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90988
* decl.c (gfc_match_private, gfc_match_public): Fixed-form source code
does not require whitespace between PRIVATE (or PUBLIC) and an entity.
2019-11-01 Tobias Burnus <tobias@codesourcery.com>
* f95-lang.c (LANG_HOOKS_OMP_ARRAY_DATA): Set to gfc_omp_array_data.
......
......@@ -9059,7 +9059,6 @@ match
gfc_match_private (gfc_statement *st)
{
gfc_state_data *prev;
char c;
if (gfc_match ("private") != MATCH_YES)
return MATCH_NO;
......@@ -9083,10 +9082,14 @@ gfc_match_private (gfc_statement *st)
return MATCH_YES;
}
/* At this point, PRIVATE must be followed by whitespace or ::. */
c = gfc_peek_ascii_char ();
if (!gfc_is_whitespace (c) && c != ':')
return MATCH_NO;
/* At this point in free-form source code, PRIVATE must be followed
by whitespace or ::. */
if (gfc_current_form == FORM_FREE)
{
char c = gfc_peek_ascii_char ();
if (!gfc_is_whitespace (c) && c != ':')
return MATCH_NO;
}
prev = gfc_state_stack->previous;
if (gfc_current_state () != COMP_MODULE
......@@ -9108,8 +9111,6 @@ gfc_match_private (gfc_statement *st)
match
gfc_match_public (gfc_statement *st)
{
char c;
if (gfc_match ("public") != MATCH_YES)
return MATCH_NO;
......@@ -9127,10 +9128,14 @@ gfc_match_public (gfc_statement *st)
return MATCH_YES;
}
/* At this point, PUBLIC must be followed by whitespace or ::. */
c = gfc_peek_ascii_char ();
if (!gfc_is_whitespace (c) && c != ':')
return MATCH_NO;
/* At this point in free-form source code, PUBLIC must be followed
by whitespace or ::. */
if (gfc_current_form == FORM_FREE)
{
char c = gfc_peek_ascii_char ();
if (!gfc_is_whitespace (c) && c != ':')
return MATCH_NO;
}
if (gfc_current_state () != COMP_MODULE)
{
......
2019-11-01 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90988
* gfortran.dg/pr90988_4.f: New test.
2019-11-01 Martin Sebor <msebor@redhat.com>
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Declare test functions
......
c { dg-do compile }
module foo
implicit none
real a,b,c
integer i,j,k
public a,b
publicc
private i,j
privatek
end module foo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment