aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-02-13 14:44:00 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-02-13 09:44:00 -0500
commit6bc7be5f89c0c51e089af3cddd2009ef3d0c889c (patch)
tree93697fc0df64993545169cd10fe3c3315167c336 /gcc
parente3e7774eb1ba129805886520d9417f28bb52a41a (diff)
downloadgcc-6bc7be5f89c0c51e089af3cddd2009ef3d0c889c.zip
gcc-6bc7be5f89c0c51e089af3cddd2009ef3d0c889c.tar.gz
gcc-6bc7be5f89c0c51e089af3cddd2009ef3d0c889c.tar.bz2
* pt.c (determine_specialization): Give better errors.
From-SVN: r17970
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c16
2 files changed, 15 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3dfba2e..bf10132 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e4fa8bb..8d15cb0 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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;