]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2012-01-31 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jan 2012 18:38:43 +0000 (18:38 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jan 2012 18:38:43 +0000 (18:38 +0000)
        PR fortran/52029
        * class.c (gfc_find_derived_vtab): Mark _copy function as pure.

2012-01-31  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52029
        * gfortran.dg/class_49.f90: New.

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

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

index b39e03798f4328fafc924ea05c15234f0ace5ae7..a0397cc3c7d2ab8815606e190c1844039223519b 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-31  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/52029
+       * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
+
 2012-01-31  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52013
index 3ff6a0bd1c1aceb450f1a67580bbad0d5a791424..0d47979cf2740ef4e4774c07b2c84e8117bdae10 100644 (file)
@@ -717,6 +717,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
                  sub_ns->proc_name = copy;
                  copy->attr.flavor = FL_PROCEDURE;
                  copy->attr.subroutine = 1;
+                 copy->attr.pure = 1;
                  copy->attr.if_source = IFSRC_DECL;
                  /* This is elemental so that arrays are automatically
                     treated correctly by the scalarizer.  */
index 3e0ca1e4ab89dd5152357395943cc7e2a60b43a7..8eb797e19a94519ac7cc37d0dd396f263056c23c 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-31  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/52029
+       * gfortran.dg/class_49.f90: New.
+
 2012-01-31  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52013
diff --git a/gcc/testsuite/gfortran.dg/class_49.f90 b/gcc/testsuite/gfortran.dg/class_49.f90
new file mode 100644 (file)
index 0000000..0c0b2b8
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+!
+! PR fortran/52029
+!
+
+elemental subroutine foo()
+  type t
+  end type t
+  class(t), allocatable :: x
+  if (allocated(x)) i = 5
+end