mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 23:31:21 +08:00
re PR fortran/60359 ([OOP] symbol `__io_MOD___copy_character_1' is already defined)
2014-02-28 Janus Weil <janus@gcc.gnu.org> PR fortran/60359 * class.c (find_intrinsic_vtab): Prevent duplicate creation of copy procedure for characters. 2014-02-28 Janus Weil <janus@gcc.gnu.org> PR fortran/60359 * gfortran.dg/unlimited_polymorphic_16.f90: New. From-SVN: r208227
This commit is contained in:
parent
f1ee5eaf07
commit
3c3f892bf0
@ -1,3 +1,9 @@
|
||||
2014-02-28 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60359
|
||||
* class.c (find_intrinsic_vtab): Prevent duplicate creation of copy
|
||||
procedure for characters.
|
||||
|
||||
2014-02-21 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60302
|
||||
|
@ -2532,17 +2532,22 @@ find_intrinsic_vtab (gfc_typespec *ts)
|
||||
c->tb = XCNEW (gfc_typebound_proc);
|
||||
c->tb->ppc = 1;
|
||||
|
||||
/* Check to see if copy function already exists. Note
|
||||
that this is only used for characters of different
|
||||
lengths. */
|
||||
contained = ns->contained;
|
||||
for (; contained; contained = contained->sibling)
|
||||
if (contained->proc_name
|
||||
&& strcmp (name, contained->proc_name->name) == 0)
|
||||
{
|
||||
copy = contained->proc_name;
|
||||
goto got_char_copy;
|
||||
}
|
||||
if (ts->type != BT_CHARACTER)
|
||||
sprintf (name, "__copy_%s", tname);
|
||||
else
|
||||
{
|
||||
/* __copy is always the same for characters.
|
||||
Check to see if copy function already exists. */
|
||||
sprintf (name, "__copy_character_%d", ts->kind);
|
||||
contained = ns->contained;
|
||||
for (; contained; contained = contained->sibling)
|
||||
if (contained->proc_name
|
||||
&& strcmp (name, contained->proc_name->name) == 0)
|
||||
{
|
||||
copy = contained->proc_name;
|
||||
goto got_char_copy;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up namespace. */
|
||||
sub_ns = gfc_get_namespace (ns, 0);
|
||||
@ -2550,11 +2555,6 @@ find_intrinsic_vtab (gfc_typespec *ts)
|
||||
ns->contained = sub_ns;
|
||||
sub_ns->resolved = 1;
|
||||
/* Set up procedure symbol. */
|
||||
if (ts->type != BT_CHARACTER)
|
||||
sprintf (name, "__copy_%s", tname);
|
||||
else
|
||||
/* __copy is always the same for characters. */
|
||||
sprintf (name, "__copy_character_%d", ts->kind);
|
||||
gfc_get_symbol (name, sub_ns, ©);
|
||||
sub_ns->proc_name = copy;
|
||||
copy->attr.flavor = FL_PROCEDURE;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-02-28 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60359
|
||||
* gfortran.dg/unlimited_polymorphic_16.f90: New.
|
||||
|
||||
2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/58610
|
||||
|
24
gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90
Normal file
24
gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90
Normal file
@ -0,0 +1,24 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! PR 60359: [OOP] symbol `__io_MOD___copy_character_1' is already defined
|
||||
!
|
||||
! Contributed by Antony Lewis <antony@cosmologist.info>
|
||||
|
||||
module IO
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
subroutine FWRite(S)
|
||||
class(*) :: S
|
||||
end subroutine
|
||||
|
||||
subroutine IO_OutputMargeStats()
|
||||
character(len=128) tag
|
||||
call FWrite(tag)
|
||||
call FWrite(' '//tag)
|
||||
end subroutine
|
||||
|
||||
end module
|
||||
|
||||
! { dg-final { cleanup-modules "IO" } }
|
Loading…
x
Reference in New Issue
Block a user