static void
get_unique_type_string (char *string, gfc_symbol *derived)
{
- /* Provide sufficient space to hold "Pdtsymbol". */
- char dt_name[GFC_MAX_SYMBOL_LEN+4];
+ const char *dt_name;
if (derived->attr.unlimited_polymorphic)
- strcpy (dt_name, "STAR");
+ dt_name = "STAR";
else
- {
- const char *upper = gfc_dt_upper_string (derived->name);
- size_t len = strnlen (upper, sizeof (dt_name));
- if (len >= sizeof (dt_name))
- gfc_internal_error ("get_unique_type_string: identifier overflow");
- memcpy (dt_name, upper, len);
- dt_name[len] = '\0';
- }
+ dt_name = gfc_dt_upper_string (derived->name);
if (derived->attr.unlimited_polymorphic)
sprintf (string, "_%s", dt_name);
else if (derived->module)
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95088 - ICE in gfc_build_class_symbol, at fortran/class.c:653
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ type t2345678901234567890123456789012345678901234567890123456789_123 &
+ (n2345678901234567890123456789012345678901234567890123456789_123,&
+ r2345678901234567890123456789012345678901234567890123456789_123,&
+ k2345678901234567890123456789012345678901234567890123456789_123,&
+ l2345678901234567890123456789012345678901234567890123456789_123 )
+ integer, kind :: n2345678901234567890123456789012345678901234567890123456789_123
+ integer, kind :: r2345678901234567890123456789012345678901234567890123456789_123
+ integer, kind :: k2345678901234567890123456789012345678901234567890123456789_123
+ integer, len :: l2345678901234567890123456789012345678901234567890123456789_123
+ complex (kind = r2345678901234567890123456789012345678901234567890123456789_123) &
+ :: z2345678901234567890123456789012345678901234567890123456789_123
+ character(kind = k2345678901234567890123456789012345678901234567890123456789_123, &
+ len = l2345678901234567890123456789012345678901234567890123456789_123) &
+ :: c2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ type, extends (t2345678901234567890123456789012345678901234567890123456789_123) :: &
+ a2345678901234567890123456789012345678901234567890123456789_123
+ end type
+ interface
+ module subroutine s2345678901234567890123456789012345678901234567890123456789_123 &
+ (x2345678901234567890123456789012345678901234567890123456789_123)
+ class(a2345678901234567890123456789012345678901234567890123456789_123(16,8,4,1234567890)) :: &
+ x2345678901234567890123456789012345678901234567890123456789_123
+ end
+ end interface
+end