* pt.c (tsubst_decl): Robustify.
authorMark Mitchell <mark@codesourcery.com>
Mon, 29 Nov 1999 23:39:29 +0000 (23:39 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 29 Nov 1999 23:39:29 +0000 (23:39 +0000)
From-SVN: r30716

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.pt/extern1.C [new file with mode: 0644]

index f07c715c56297635d9928aa84a0e39e9880e28e3..c78735ef314db790dabd88f61e81176eb9d38824 100644 (file)
@@ -1,3 +1,7 @@
+1999-11-29  Mark Mitchell  <mark@codesourcery.com>
+
+       * pt.c (tsubst_decl): Robustify.
+
 1999-11-27  Mark Mitchell  <mark@codesourcery.com>
 
        * decl2.c (finish_file): Call expand_body for inline functions
index dde6562cd982dd69f0e3191c8d71681fecf97577..ed9e8485ff742309d7b42ad7556d55f6e4d66d33 100644 (file)
@@ -5863,7 +5863,7 @@ tsubst_decl (t, args, type, in_decl)
        my_friendly_assert (DECL_LANG_SPECIFIC (t) 
                            && DECL_TEMPLATE_INFO (t) != NULL_TREE, 0);
 
-       if (TYPE_P (DECL_CONTEXT (t)))
+       if (TYPE_P (CP_DECL_CONTEXT (t)))
          ctx = tsubst_aggr_type (DECL_CONTEXT (t), args, 
                                  /*complain=*/1,
                                  in_decl, /*entering_scope=*/1);
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/extern1.C b/gcc/testsuite/g++.old-deja/g++.pt/extern1.C
new file mode 100644 (file)
index 0000000..1d4ebb8
--- /dev/null
@@ -0,0 +1,13 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+void f ()
+{
+  extern int i;
+  extern T j;
+  
+  i = j;
+}
+
+template void f<int>();