OSDN Git Service

* friend.c (make_friend_class): Avoid core dump when
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Mar 1999 01:21:05 +0000 (01:21 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Mar 1999 01:21:05 +0000 (01:21 +0000)
not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
* decl.c (start_function): Suppress normal linkage heuristics
for #pragma interface under MULTIPLE_SYMBOL_SPACES.

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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/friend.c

index ddbecb5..1876601 100644 (file)
@@ -1,3 +1,13 @@
+1999-03-19  Chip Salzenberg  <chip@perlsupport.com>
+
+       * friend.c (make_friend_class): Avoid core dump when
+       not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
+
+1999-03-18  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (start_function): Suppress normal linkage heuristics
+       for #pragma interface under MULTIPLE_SYMBOL_SPACES.
+
 1999-03-19  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * Make-lang.in: ($(INTL_TARGETS)): depend on cp/parse.c
index a416c2d..200c8c4 100644 (file)
@@ -13133,6 +13133,20 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
       DECL_NOT_REALLY_EXTERN (decl1) = 0;
       DECL_INTERFACE_KNOWN (decl1) = 1;
     }
+  else if (interface_unknown && interface_only
+          && (! DECL_TEMPLATE_INSTANTIATION (decl1)
+              || flag_alt_external_templates))
+    {
+      /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma
+        interface, we will have interface_only set but not
+        interface_known.  In that case, we don't want to use the normal
+        heuristics because someone will supply a #pragma implementation
+        elsewhere, and deducing it here would produce a conflict.  */
+      comdat_linkage (decl1);
+      DECL_EXTERNAL (decl1) = 0;
+      DECL_INTERFACE_KNOWN (decl1) = 1;
+      DECL_DEFER_OUTPUT (decl1) = 1;
+    }
   else
     {
       /* This is a definition, not a reference.
index 8bcdcc4..30b3c51 100644 (file)
@@ -263,7 +263,8 @@ make_friend_class (type, friend_type)
       return;
     }
 
-  if (CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
+  if (CLASS_TYPE_P (friend_type)
+      && CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
       && uses_template_parms (friend_type))
     {
       /* [temp.friend]