summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-04 12:59:23 +0000
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-04 12:59:23 +0000
commit606bca172d5d64866ab73d4a809caaa6f0fc6825 (patch)
treead7aeb9ba407e12cd837ac0b835b5dbf1b16ac44
parent11efe736b913c252b3ca50c066351015d7a62f57 (diff)
downloadppe42-gcc-606bca172d5d64866ab73d4a809caaa6f0fc6825.tar.gz
ppe42-gcc-606bca172d5d64866ab73d4a809caaa6f0fc6825.zip
2011-01-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/46448 * class.c (gfc_find_derived_vtab): Set the module field for the copying routine to make sure it receives module name mangling. 2011-01-04 Janus Weil <janus@gcc.gnu.org> PR fortran/46448 * gfortran.dg/class_34.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168464 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/class.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/class_34.f9024
4 files changed, 37 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 015010802d8..800fc3aea87 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/46448
+ * class.c (gfc_find_derived_vtab): Set the module field for the copying
+ routine to make sure it receives module name mangling.
+
2011-01-03 Jakub Jelinek <jakub@redhat.com>
* gfortranspec.c (lang_specific_driver): Update copyright notice
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 5b6851b49f3..7095d3ea752 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -528,6 +528,8 @@ gfc_find_derived_vtab (gfc_symbol *derived)
sub_ns->proc_name = copy;
copy->attr.flavor = FL_PROCEDURE;
copy->attr.if_source = IFSRC_DECL;
+ if (ns->proc_name->attr.flavor == FL_MODULE)
+ copy->module = ns->proc_name->name;
gfc_set_sym_referenced (copy);
/* Set up formal arguments. */
gfc_get_symbol ("src", sub_ns, &src);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e6977960fd8..824479bad8b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/46448
+ * gfortran.dg/class_34.f90: New.
+
2011-01-04 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.dg/torture/builtin-cproj-1.c: On the __SPU__ target, do not
diff --git a/gcc/testsuite/gfortran.dg/class_34.f90 b/gcc/testsuite/gfortran.dg/class_34.f90
new file mode 100644
index 00000000000..ecdb4ddc802
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_34.f90
@@ -0,0 +1,24 @@
+! { dg-do compile }
+!
+! PR 46448: [4.6 Regression] [OOP] symbol `__copy_...' is already defined
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module m0
+ type :: t
+ end type
+end module
+
+module m1
+ use m0
+ class(t), pointer :: c1
+end module
+
+module m2
+ use m0
+ class(t), pointer :: c2
+end module
+
+end
+
+! { dg-final { cleanup-modules "m0 m1 m2" } }
OpenPOWER on IntegriCloud