typeck.c (mark_addressable): Don't assume a FUNCTION_DECL has DECL_LANG_SPECIFIC.
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 25 Nov 1997 07:00:30 +0000 (07:00 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 25 Nov 1997 07:00:30 +0000 (02:00 -0500)
* typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
has DECL_LANG_SPECIFIC.

From-SVN: r16695

gcc/cp/ChangeLog
gcc/cp/typeck.c

index ad1788b304e1c8000e7c246060e83621709523e9..8af98a4f8aede49b6baedcf975f1ecfd27f9701b 100644 (file)
@@ -1,5 +1,8 @@
 Mon Nov 24 12:15:55 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
+       has DECL_LANG_SPECIFIC.
+
        * exception.cc (struct cp_eh_info): Add handlers field.
        (__cp_push_exception): Initialize it.
        (__cp_pop_exception): Decrement it.  Don't pop unless it's 0.
index 39a71205b997d3983b20c9d839ea85c476052e05..bd5a43cd9ecf9f797c507935391af48354d6887a 100644 (file)
@@ -4807,12 +4807,15 @@ mark_addressable (exp)
        return 1;
 
       case FUNCTION_DECL:
-       /* We have to test both conditions here.  The first may
-          be non-zero in the case of processing a default function.
-          The second may be non-zero in the case of a template function.  */
-       x = DECL_MAIN_VARIANT (x);
-       if (DECL_TEMPLATE_INFO (x) && !DECL_TEMPLATE_SPECIALIZATION (x))
-         mark_used (x);
+       if (DECL_LANG_SPECIFIC (x) != 0)
+         {
+           x = DECL_MAIN_VARIANT (x);
+           /* We have to test both conditions here.  The first may be
+              non-zero in the case of processing a default function.  The
+              second may be non-zero in the case of a template function.  */
+           if (DECL_TEMPLATE_INFO (x) && !DECL_TEMPLATE_SPECIALIZATION (x))
+             mark_used (x);
+         }
        TREE_ADDRESSABLE (x) = 1;
        TREE_USED (x) = 1;
        TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;