[Bug fortran/39996] Double typing of function results not detected

2009-05-14 Thread janus at gcc dot gnu dot org


--- Comment #3 from janus at gcc dot gnu dot org  2009-05-14 09:46 ---
Fixed with r147528. Closing.


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/39996] Double typing of function results not detected

2009-05-14 Thread janus at gcc dot gnu dot org


--- Comment #2 from janus at gcc dot gnu dot org  2009-05-14 09:42 ---
Subject: Bug 39996

Author: janus
Date: Thu May 14 09:41:41 2009
New Revision: 147528

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147528
Log:
2009-05-14  Janus Weil  

PR fortran/39996
* decl.c (gfc_match_function_decl): Use gfc_add_type.
* symbol.c (gfc_add_type): Better checking for duplicate types in
function declarations. And: Always give an error for duplicte types,
not just a warning with -std=gnu.


2009-05-14  Janus Weil  

PR fortran/39996
* gfortran.dg/func_decl_2.f90: Modified (replacing warnings by errors).
* gfortran.dg/duplicate_type_2.f90: Ditto.
* gfortran.dg/duplicate_type_3.f90: New.


Added:
trunk/gcc/testsuite/gfortran.dg/duplicate_type_3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/symbol.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/duplicate_type_2.f90
trunk/gcc/testsuite/gfortran.dg/func_decl_2.f90


-- 


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



[Bug fortran/39996] Double typing of function results not detected

2009-05-09 Thread janus at gcc dot gnu dot org


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-05-05 20:35:34 |2009-05-09 20:53:00
   date||


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



[Bug fortran/39996] Double typing of function results not detected

2009-05-05 Thread janus at gcc dot gnu dot org


--- Comment #1 from janus at gcc dot gnu dot org  2009-05-05 20:35 ---
Extended test case, including six similar cases, of which only the first three
are detected (comment #0 corresponds to case 'E'):

  ! Detected:
  interface
real function A ()
end function
  end interface
  real :: A ! Error: Symbol 'a' at (1) already has basic type of REAL

  ! Detected:
  real :: B
  interface
real function B () ! Error: Function 'b' at (1) already has a type of REAL
end function
  end interface

  ! Detected:
  interface
function C ()
  real :: C
end function
  end interface
  real :: C ! Error: Symbol 'c' at (1) already has basic type of REAL

  ! Not Detected:
  real :: D
  interface
function D ()
  real :: D
end function
  end interface

  ! Not Detected:
  interface
function E () result (s)
  real ::s
end function
  end interface
  real :: E

  ! Not Detected:
  real :: F
  interface
function F () result (s)
  real ::s
end function F
  end interface

end


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-05-05 20:35:34
   date||


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