OSDN Git Service

* pt.c (determine_specialization): Give helpful error about missing
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Nov 2009 20:55:17 +0000 (20:55 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Nov 2009 20:55:17 +0000 (20:55 +0000)
"template<>".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154518 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/spec15.C

index b40ddb6..ba3bbf2 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-24  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (determine_specialization): Give helpful error about missing
+       "template<>".
+
 2009-11-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/42095
index 2e58ed9..dfe7791 100644 (file)
@@ -1945,6 +1945,10 @@ determine_specialization (tree template_id,
     {
       error ("template-id %qD for %q+D does not match any template "
             "declaration", template_id, decl);
+      if (header_count && header_count != template_count + 1)
+       inform (input_location, "saw %d %<template<>%>, need %d for "
+               "specializing a member function template",
+               header_count, template_count + 1);
       return error_mark_node;
     }
   else if ((templates && TREE_CHAIN (templates))
index 2888410..dcf5724 100644 (file)
@@ -1,3 +1,7 @@
+2009-11-23  Jason Merrill  <jason@redhat.com>
+
+       * g++.dg/template/spec15.C: Check for helpful message.
+
 2009-11-24  Janis Johnson  <janis187@us.ibm.com>
 
        * gcc.target/powerpc/altivec-32.c: Don't use -m64.
index fcf4ecb..37fbc08 100644 (file)
@@ -19,6 +19,7 @@ struct A<float> {
 };
 
 template <> void A<int>::f (int);                    // { dg-error "" }
+// { dg-message "need 2" "" { target *-*-* } 21 }
 template <> template <> void A<int>::f (int);
 
 template <> void A<int>::f2 (int);