Bug 19260 - & not required when splitting a token in continuation
Summary: & not required when splitting a token in continuation
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P3 minor
Target Milestone: 4.2.0
Assignee: Jerry DeLisle
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2005-01-05 11:12 UTC by Thomas Koenig
Modified: 2006-10-03 04:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-09 06:59:44


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:12:21 UTC
$ cat continuation.f90
print *,s&
in(1.)
end
$ gfortran continuation.f90
$ ./a.out
  0.8414710
$ 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

The above program is illegal, there should be a "&" as the first
nonblank character in the second line.
Comment 1 Tobias Schlüter 2005-01-05 18:10:58 UTC
Confirmed. See sec. 3.3.1.3.1.
Comment 2 Andrew Pinski 2005-04-08 21:00:42 UTC
Isn't this a dup of bug 19101?
Comment 3 Andrew Pinski 2006-01-08 06:00:36 UTC
(In reply to comment #2)
> Isn't this a dup of bug 19101?
No but it is related to it.
Comment 4 Jerry DeLisle 2006-03-09 06:59:44 UTC
I will see if I can fix this.  I fear some serious messing with all the matching routines may be required if it can not be handled in scanner.c
Comment 5 patchapp@dberlin.org 2006-09-20 02:45:34 UTC
Subject: Bug number PR19260

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-09/msg00854.html
Comment 6 Jerry DeLisle 2006-10-03 03:58:30 UTC
Subject: Bug 19260

Author: jvdelisle
Date: Tue Oct  3 03:58:20 2006
New Revision: 117384

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

    PR fortran/19262
    * gfortran.h (gfc_option_t): Add max_continue_fixed and max_continue_free.
    * options.c (gfc_init_options): Initialize fixed form and free form
    consecutive continuation line limits.
    * scanner.c (gfc_scanner_init_1): Initialize continue_line
    and continue_count. (gfc_next_char_literal): Count the number of
    continuation lines in the current statement and warn if
    limit is exceeded.

2006-10-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

    PR fortran/19260
    * scanner.c (gfc_next_char_literal): Add check for missing '&'
    and warn if in_string, otherwise return ' '.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/options.c
    trunk/gcc/fortran/scanner.c

Comment 7 Jerry DeLisle 2006-10-03 04:10:13 UTC
Subject: Bug 19260

Author: jvdelisle
Date: Tue Oct  3 04:09:49 2006
New Revision: 117385

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

	PR fortran/19260
	* gfortran.dg/continuation.f90: Rename to continuation_1.f90.
	* gfortran.dg/continuation_2.f90: New test.

	PR fortran/19262
	* gfortran.dg/continuation_3.f90: New test.
	* gfortran.dg/continuation_4.f90: New test.
	* gfortran.dg/continuation_5.f: New test.
	* gfortran.dg/continuation_6.f: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/continuation_1.f90
      - copied unchanged from r117065, trunk/gcc/testsuite/gfortran.dg/continuation.f90
    trunk/gcc/testsuite/gfortran.dg/continuation_2.f90
    trunk/gcc/testsuite/gfortran.dg/continuation_3.f90
    trunk/gcc/testsuite/gfortran.dg/continuation_4.f90
    trunk/gcc/testsuite/gfortran.dg/continuation_5.f
    trunk/gcc/testsuite/gfortran.dg/continuation_6.f
Removed:
    trunk/gcc/testsuite/gfortran.dg/continuation.f90
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 8 Jerry DeLisle 2006-10-03 04:11:56 UTC
Fixed on 4.2
Comment 9 patchapp@dberlin.org 2006-10-05 17:34:00 UTC
Subject: Bug number PR19260

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/msg00255.html