]> gcc.gnu.org Git - gcc.git/commitdiff
* pt.c (determine_specialization): Give better errors.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 13 Feb 1998 14:44:00 +0000 (14:44 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 13 Feb 1998 14:44:00 +0000 (09:44 -0500)
From-SVN: r17970

gcc/cp/ChangeLog
gcc/cp/pt.c

index 3dfba2e3bdd206eb1a6682546f1d061169a1113d..bf101322feac9f5d233fadd78087f937c0f4f3e0 100644 (file)
@@ -1,3 +1,7 @@
+Fri Feb 13 14:30:35 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (determine_specialization): Give better errors.
+
 Fri Feb 13 14:06:22 1998  Mike Stump  <mrs@wrs.com>
 
        * init.c (build_new): Propagate error_mark_node up.
index e4fa8bb29b9286da6c996496c8b5ffefdba8a388..8d15cb009de631ea678a825997dc6435693bbb64 100644 (file)
@@ -519,7 +519,15 @@ determine_specialization (template_id, decl, targs_out,
        tmpl = DECL_TI_TEMPLATE (fn);
       else if (TREE_CODE (fn) != TEMPLATE_DECL
               || (need_member_template && !is_member_template (fn)))
-       continue;
+       {
+         if (decls_match (decl, fn))
+           {
+             cp_error ("`template <>' applied to non-specialization `%D'",
+                       fn);
+             return NULL_TREE;
+           }
+         continue;
+       }
       else
        tmpl = fn;
 
@@ -564,8 +572,7 @@ determine_specialization (template_id, decl, targs_out,
     {
     no_match:
       if (complain)
-       cp_error ("`%D' does not match any template declaration",
-                 template_id);
+       cp_error ("`%D' does not match any template declaration", decl);
       
       return NULL_TREE;
     }
@@ -574,8 +581,7 @@ determine_specialization (template_id, decl, targs_out,
     ambiguous:
       if (complain)
        {
-         cp_error ("ambiguous template specialization `%D'",
-                   template_id);
+         cp_error ("ambiguous template specialization `%D'", decl);
          print_candidates (templates);
        }
       return NULL_TREE;
This page took 0.089368 seconds and 5 git commands to generate.