public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34432]  New: integer(kind=init_expression) function  is rejected
@ 2007-12-11 13:02 burnus at gcc dot gnu dot org
  2007-12-11 13:04 ` [Bug fortran/34432] " jv244 at cam dot ac dot uk
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-11 13:02 UTC (permalink / raw)
  To: gcc-bugs

I believe the following code is valid and it is accepted by NAG f95, ifort and
g95. Gfortran rejects it with

   Error: Invalid character in name at (1)


module m
  integer, parameter :: int_t = kind(4)
end module m

integer(kind=(int_t)) function test4()
  use m
  test4 = 1
end function test4


For the following -- extra ")" -- I got a not so helpful error message:

integer(kind=int_t)) function test4()
  use m
  test4 = 1
end function test4


-- 
           Summary: integer(kind=init_expression) function  is rejected
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
@ 2007-12-11 13:04 ` jv244 at cam dot ac dot uk
  2007-12-14  2:18 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jv244 at cam dot ac dot uk @ 2007-12-11 13:04 UTC (permalink / raw)
  To: gcc-bugs



-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32834
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-11 13:04:01
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
  2007-12-11 13:04 ` [Bug fortran/34432] " jv244 at cam dot ac dot uk
@ 2007-12-14  2:18 ` jvdelisle at gcc dot gnu dot org
  2007-12-14 14:00 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-14  2:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-12-14 02:18 -------
I am testing a patch that adds a gfc_match_parens function that can be used
selectively to catch these imbalances and give a useful message.  I am using it
for pr34325 a the moment, but it can be used elsewhere.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
  2007-12-11 13:04 ` [Bug fortran/34432] " jv244 at cam dot ac dot uk
  2007-12-14  2:18 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-14 14:00 ` burnus at gcc dot gnu dot org
  2007-12-16  7:07 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-14 14:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-12-14 14:00 -------
The problem for (...) expressions is:

In match_primary, several gfc_match_* are called, which all return MATCH_NO,
until  gfc_match_char ('('), which returns true. (So far so good.)

However, before "gfc_match_char" there is a call to gfc_match_rvalue.
gfc_match_rvalue calls gfc_match_name -- and the latter not only returns
MATCH_NO, but also issues

      if (gfc_error_flag_test() == 0)
        gfc_error ("Invalid character in name at %C");

which is at the heart of the problem. Without the call to gfc_error, the
program works.

The next question is how to solve this without breaking the diagnostics. I'd
assume this affects much more expressions than this one.

I was thinking of a flag (like "bool match_only"), which means that on needs to
audit all 37 uses of gfc_match_name.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-12-14 14:00 ` burnus at gcc dot gnu dot org
@ 2007-12-16  7:07 ` jvdelisle at gcc dot gnu dot org
  2008-01-12  8:49 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-16  7:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-12-16 07:07 -------
This one interests me.  I will try.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-12-11 13:04:01         |2007-12-16 07:07:43
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-12-16  7:07 ` jvdelisle at gcc dot gnu dot org
@ 2008-01-12  8:49 ` jvdelisle at gcc dot gnu dot org
  2008-01-12  9:43 ` jvdelisle at gcc dot gnu dot org
  2008-01-12 10:50 ` jvdelisle at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-01-12  8:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2008-01-12 08:37 -------
Subject: Bug 34432

Author: jvdelisle
Date: Sat Jan 12 08:36:52 2008
New Revision: 131488

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131488
Log:
2008-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/34432
        * match.c (gfc_match_name): Don't error if leading character is a '(',
        just return MATCH_NO.

Modified:
    trunk/gcc/fortran/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-01-12  8:49 ` jvdelisle at gcc dot gnu dot org
@ 2008-01-12  9:43 ` jvdelisle at gcc dot gnu dot org
  2008-01-12 10:50 ` jvdelisle at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-01-12  9:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-01-12 08:48 -------
Subject: Bug 34432

Author: jvdelisle
Date: Sat Jan 12 08:47:27 2008
New Revision: 131489

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131489
Log:
2008-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/34432
        * gfortran.dg/parens_7.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/parens_7.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/34432] integer(kind=init_expression) function  is rejected
  2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-01-12  9:43 ` jvdelisle at gcc dot gnu dot org
@ 2008-01-12 10:50 ` jvdelisle at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-01-12 10:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2008-01-12 08:49 -------
Fixed on trunk.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-01-12  8:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11 13:02 [Bug fortran/34432] New: integer(kind=init_expression) function is rejected burnus at gcc dot gnu dot org
2007-12-11 13:04 ` [Bug fortran/34432] " jv244 at cam dot ac dot uk
2007-12-14  2:18 ` jvdelisle at gcc dot gnu dot org
2007-12-14 14:00 ` burnus at gcc dot gnu dot org
2007-12-16  7:07 ` jvdelisle at gcc dot gnu dot org
2008-01-12  8:49 ` jvdelisle at gcc dot gnu dot org
2008-01-12  9:43 ` jvdelisle at gcc dot gnu dot org
2008-01-12 10:50 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).