public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/46313] [OOP] class container naming collisions
Date: Fri, 07 Jan 2011 13:02:00 -0000	[thread overview]
Message-ID: <bug-46313-4-bJXcuBwMEn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46313-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from janus at gcc dot gnu.org 2011-01-07 12:58:07 UTC ---
(In reply to comment #19)
> In the dump you can see that we end up with one vtab for both types.

This is easily fixed by putting the first letter of the derived type name in
upper case:


Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 168565)
+++ gcc/fortran/class.c (working copy)
@@ -116,13 +116,16 @@

 static void
 get_unique_type_string (char *string, gfc_symbol *derived)
-{  
+{
+  char dt_name[GFC_MAX_SYMBOL_LEN+1];
+  sprintf (dt_name, "%s", derived->name);
+  dt_name[0] = TOUPPER (dt_name[0]);
   if (derived->module)
-    sprintf (string, "%s_%s", derived->module, derived->name);
+    sprintf (string, "%s_%s", derived->module, dt_name);
   else if (derived->ns->proc_name)
-    sprintf (string, "%s_%s", derived->ns->proc_name->name, derived->name);
+    sprintf (string, "%s_%s", derived->ns->proc_name->name, dt_name);
   else
-    sprintf (string, "_%s", derived->name);
+    sprintf (string, "_%s", dt_name);
 }


For a proper runtime test case, one could just add a call to
"same_type_as(a1,a2)" to comment #19.


  parent reply	other threads:[~2011-01-07 12:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05 14:44 [Bug fortran/46313] New: [OOP] OOP-ABI issue, ALLOCATE issue, CLASS renaming issue burnus at gcc dot gnu.org
2010-11-05 15:47 ` [Bug fortran/46313] " kargl at gcc dot gnu.org
2010-11-05 16:04 ` sgk at troutmask dot apl.washington.edu
2010-11-06  0:38 ` kargl at gcc dot gnu.org
2010-11-06 15:26 ` janus at gcc dot gnu.org
2010-11-09 10:40 ` janus at gcc dot gnu.org
2010-11-09 11:54 ` janus at gcc dot gnu.org
2010-11-09 12:52 ` [Bug fortran/46313] [OOP] class container naming collisions janus at gcc dot gnu.org
2010-11-09 13:52 ` burnus at gcc dot gnu.org
2010-11-09 16:32 ` janus at gcc dot gnu.org
2010-11-09 17:07 ` janus at gcc dot gnu.org
2010-11-09 17:59 ` janus at gcc dot gnu.org
2010-11-09 18:16 ` burnus at gcc dot gnu.org
2010-11-09 18:24 ` burnus at gcc dot gnu.org
2010-11-09 18:28 ` sgk at troutmask dot apl.washington.edu
2010-11-09 18:43 ` burnus at gcc dot gnu.org
2010-12-16  8:37 ` burnus at gcc dot gnu.org
2011-01-02 19:28 ` janus at gcc dot gnu.org
2011-01-07 10:00 ` burnus at gcc dot gnu.org
2011-01-07 12:35 ` janus at gcc dot gnu.org
2011-01-07 13:02 ` janus at gcc dot gnu.org [this message]
2011-01-07 14:01 ` burnus at gcc dot gnu.org
2011-01-07 14:02 ` burnus at gcc dot gnu.org
2011-01-09 11:20 ` janus at gcc dot gnu.org
2011-01-09 11:25 ` janus at gcc dot gnu.org
2011-01-09 12:42 ` burnus at gcc dot gnu.org
2011-09-10  8:41 ` janus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46313-4-bJXcuBwMEn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).