Bug 19261 - continuation character illegal as first non-blank character in statement
Summary: continuation character illegal as first non-blank character in statement
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords: accepts-invalid
: 20898 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-05 11:16 UTC by Thomas Koenig
Modified: 2006-10-14 15:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-09-20 05:19:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Koenig 2005-01-05 11:16:32 UTC
$ cat continuation-2.f90
 &

end
$ gfortran continuation-2.f90
$ cat continuation-3.f90
 &
end
$ gfortran continuation-3.f90
$ gfortran -v
Using built-in specs.
Configured with: ../gcc-4.0-20050102/configure --prefix=/home/zfkts
--enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20050102 (experimental)
$ gfortran -dumpmachine
ia64-unknown-linux-gnu

Both programs above have the same syntax error: starting a
statement with & is illegal.
Comment 1 Thomas Koenig 2005-01-05 11:18:31 UTC
The following is also illegal:

$ cat continuation-4.f90
 &  ! This is a comment

end
$ gfortran continuation-4.f90
Comment 2 Tobias Schlüter 2005-01-05 18:11:59 UTC
Confirmed. See 3.3.1.3.
Comment 3 Andrew Pinski 2005-04-08 21:01:11 UTC
*** Bug 20898 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Pinski 2005-04-08 21:01:59 UTC
Isn't this related to or at least a dup of bug 19101?
Comment 5 Thomas Koenig 2005-04-08 22:19:10 UTC
(In reply to comment #4)
> Isn't this related to or at least a dup of bug 19101?

A different bug because a different provision of the standard
is violated.  Probably, a meta-bug "parser-related bugs"
could be introduced with this bug, 19101 and a few more.
Comment 6 Jerry DeLisle 2006-09-28 22:40:48 UTC
I have this one fixed and will combine it with the pathes for 19260 and 19262.
Comment 7 patchapp@dberlin.org 2006-10-06 07:02:01 UTC
Subject: Bug number PR19261

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00281.html
Comment 8 Jerry DeLisle 2006-10-14 15:06:44 UTC
Subject: Bug 19261

Author: jvdelisle
Date: Sat Oct 14 15:06:34 2006
New Revision: 117733

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117733
Log:
2006-10-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/19261
	* scanner.c (load_line): Add checks for illegal use of '&' and issue
	warnings.  Issue errors with -pedantic.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/scanner.c

Comment 9 Jerry DeLisle 2006-10-14 15:16:09 UTC
Fixed on svn trunk.  Note: Could not get a test case to work properly with the dejagnu machinery.