decl.c (select_decl): Allow class templates when we need types.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Fri, 12 Mar 1999 23:17:05 +0000 (23:17 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Fri, 12 Mar 1999 23:17:05 +0000 (23:17 +0000)
        * decl.c (select_decl): Allow class templates when we need types.
        * decl2.c (ambiguous_decl): Likewise.

From-SVN: r25737

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/decl2.c

index e43e9c88113d54fd5d00cc3b276a713902639ff8..d24c458cd4b1909b358db203cd24c7a2db8c0ecc 100644 (file)
@@ -1,3 +1,8 @@
+1999-03-12  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * decl.c (select_decl): Allow class templates when we need types.
+       * decl2.c (ambiguous_decl): Likewise.
+
 1999-03-12  Mark Mitchell  <mark@markmitchell.com>
 
        * lex.c (do_identifier): Correct call to enforce_access.
index 9a51e651404c0ed5dbee05ed786237e292152d73..5eca402cc0b5d8d5b08c6de953cc27cb839d2cba 100644 (file)
@@ -5246,7 +5246,8 @@ select_decl (binding, flags)
     val = TYPE_STUB_DECL (BINDING_TYPE (binding));
   /* Don't return non-types if we really prefer types. */
   else if (val && LOOKUP_TYPES_ONLY (flags)  && TREE_CODE (val) != TYPE_DECL
-          && (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL))
+          && (TREE_CODE (val) != TEMPLATE_DECL
+              || !DECL_CLASS_TEMPLATE_P (val)))
     val = NULL_TREE;
 
   return val;
index d9c1591edad5b08953e23e62cef568931bf4a4b4..56f583906e55c690dfc472fec47efb3b6931baca 100644 (file)
@@ -4063,8 +4063,7 @@ ambiguous_decl (name, old, new, flags)
         /* If we expect types or namespaces, and not templates,
            or this is not a template class. */
         if (LOOKUP_QUALIFIERS_ONLY (flags)
-            && (!(flags & LOOKUP_TEMPLATES_EXPECTED)
-                || !DECL_CLASS_TEMPLATE_P (val)))
+            && !DECL_CLASS_TEMPLATE_P (val))
           val = NULL_TREE;
         break;
       case TYPE_DECL: