]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h: Declare flag_use_repository.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 19 Aug 1999 23:29:45 +0000 (23:29 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 19 Aug 1999 23:29:45 +0000 (19:29 -0400)
* cp-tree.h: Declare flag_use_repository.
* pt.c (do_decl_instantiation): Don't complain about duplicate
instantiation with -frepo.
(do_type_instantiation): Likewise.

* decl2.c (lookup_arg_dependent): Note that we've already checked
the current namespace.

From-SVN: r28772

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/pt.c

index 82d1a8bc239867a46d6deba792b30b1c0379ce2d..5c44b60af358ab59b9ac5156d5ad3e74088a0308 100644 (file)
@@ -1,3 +1,15 @@
+1999-08-19  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * cp-tree.h: Declare flag_use_repository.
+       * pt.c (do_decl_instantiation): Don't complain about duplicate
+       instantiation with -frepo.
+       (do_type_instantiation): Likewise.
+
+1999-08-14  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl2.c (lookup_arg_dependent): Note that we've already checked
+       the current namespace.
+
 Mon Aug 16 01:29:24 PDT 1999 Jeff Law  (law@cygnus.com)
 
        * gcc-2.95.1 Released.
index 7d643078deebc5655b709adf0ccc58318fd48bb4..71809159ea45540565f4b0cacc39a3b631539514 100644 (file)
@@ -543,6 +543,10 @@ extern int flag_guiding_decls;
    and class qualifiers.       */
 extern int flag_do_squangling;
 
+/* Nonzero means generate separate instantiation control files and juggle
+   them at link time.  */
+extern int flag_use_repository;
+
 /* Nonzero if we want to issue diagnostics that the standard says are not
    required.  */
 extern int flag_optional_diags;
index 84f491f437cf85d154559275bc5e6710fac85bf2..d6fb7bf90fad01a0111e4ef7e7faa0aff8dc4f73 100644 (file)
@@ -4892,11 +4892,19 @@ lookup_arg_dependent (name, fns, args)
      tree args;
 {
   struct arg_lookup k;
+
   k.name = name;
   k.functions = fns;
-  k.namespaces = NULL_TREE;
   k.classes = NULL_TREE;
-  
+
+  /* Note that we've already looked at the current namespace during normal
+     unqualified lookup, unless we found a decl in function scope.  */
+  if (fns && ! TREE_PERMANENT (OVL_CURRENT (fns)))
+    k.namespaces = NULL_TREE;
+  else
+    k.namespaces = scratch_tree_cons (current_decl_namespace (),
+                                     NULL_TREE, NULL_TREE);
+
   push_scratch_obstack ();
   arg_assoc_args (&k, args);
   pop_obstacks ();
index 47fa99a5c43104860ec03794a33163cb30442116..69dfa97e61adaf4b5cf9fcb08ea76c5882d5e0d9 100644 (file)
@@ -8924,7 +8924,7 @@ do_decl_instantiation (declspecs, declarator, storage)
         We check DECL_INTERFACE_KNOWN so as not to complain when the
         first instantiation was `extern' and the second is not, and
         EXTERN_P for the opposite case.  */
-      if (DECL_INTERFACE_KNOWN (result) && !extern_p)
+      if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository)
        cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
 
       /* If we've already instantiated the template, just return now.  */
@@ -9052,8 +9052,8 @@ do_type_instantiation (t, storage)
          If CLASSTYPE_INTERFACE_ONLY, then the first explicit
         instantiation was `extern', and if EXTERN_P then the second
         is.  Both cases are OK.  */
-      if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p)
-       cp_error ("duplicate explicit instantiation of `%#T'", t);
+      if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p && !flag_use_repository)
+       cp_pedwarn ("duplicate explicit instantiation of `%#T'", t);
       
       /* If we've already instantiated the template, just return now.  */
       if (!CLASSTYPE_INTERFACE_ONLY (t))