OSDN Git Service

2010-02-02 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Feb 2010 13:05:50 +0000 (13:05 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Feb 2010 13:05:50 +0000 (13:05 +0000)
        PR fortran/42650
        * parse.c (decode_specification_statement): Use sym->result not
        * sym.

2010-02-02  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42650
        * gfortran.dg/func_result_5.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156449 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/func_result_5.f90 [new file with mode: 0644]

index 9e76755..9fff7ca 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-02  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/42650
+       * parse.c (decode_specification_statement): Use sym->result not sym.
+
 2010-02-01  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/42922
index 8f7ec29..9e8a123 100644 (file)
@@ -111,7 +111,7 @@ decode_specification_statement (void)
   match ("import", gfc_match_import, ST_IMPORT);
   match ("use", gfc_match_use, ST_USE);
 
-  if (gfc_current_block ()->ts.type != BT_DERIVED)
+  if (gfc_current_block ()->result->ts.type != BT_DERIVED)
     goto end_of_block;
 
   match (NULL, gfc_match_st_function, ST_STATEMENT_FUNCTION);
index c68fe11..d409f98 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-02  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/42650
+       * gfortran.dg/func_result_5.f90: New test.
+
 2010-02-01  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/42922
diff --git a/gcc/testsuite/gfortran.dg/func_result_5.f90 b/gcc/testsuite/gfortran.dg/func_result_5.f90
new file mode 100644 (file)
index 0000000..5faff39
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! PR fortran/42650
+!
+! Result type was not working
+!
+
+type(t) function func2() result(res)
+  type t
+    sequence
+    integer :: i = 5
+  end type t
+  res%i = 2
+end function func2