if (gfc_current_form == FORM_FREE)
{
char c = gfc_peek_ascii_char ();
- if (c != ' ' && c != '*' && c != '\'' && c != '"')
+
+ /* Issue a warning for an invalid tab in 'print<tab>*'. After
+ the warning is issued, consume any other whitespace and check
+ that the next char is an *, ', or ". */
+ if (c == '\t')
+ {
+ gfc_gobble_whitespace ();
+ c = gfc_peek_ascii_char ();
+ if (c != '*' && c != '\'' && c != '"')
+ {
+ m = MATCH_NO;
+ goto cleanup;
+ }
+ }
+ else if (c != ' ' && c != '*' && c != '\'' && c != '"')
{
m = MATCH_NO;
goto cleanup;
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Wtabs" }
+program foo
+ ! The next statement has a tab between 'print' and '*'.
+ print *, 'tab warning' ! { dg-warning "Nonconforming tab" }
+end program foo