[Bug c++/14971] better error message for partial specialization of function templates requested

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Fri Apr 16 14:03:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-04-16 13:42 -------
This is so trivial that it can probably slip in without a copyright 
assignment. I don't know whether this is the right way to handle long 
error messages, and also note that this is completely untested (no 
time, sorry). 
 
W. 
 
2004-04-16  Wolfgang Bangerth  (bangerth@dealii.org) 
 
        PR c++/14971 
	* pt.c (check_explicit_specialization): Improve wording of 
	error message 
 
 
Index: pt.c 
=================================================================== 
RCS file: /cvsroot/gcc/gcc/gcc/cp/pt.c,v 
retrieving revision 1.816.2.23 
diff -c -r1.816.2.23 pt.c 
*** pt.c        31 Mar 2004 02:09:59 -0000      1.816.2.23 
--- pt.c        16 Apr 2004 13:40:03 -0000 
*************** 
*** 1696,1702 **** 
             template <class T> void f<int>(); */ 
   
          if (uses_template_parms (declarator)) 
!           error ("partial specialization `%D' of function template", 
                      declarator); 
          else 
            error ("template-id `%D' in declaration of primary template", 
--- 1696,1703 ---- 
             template <class T> void f<int>(); */ 
   
          if (uses_template_parms (declarator)) 
!           error ("partial specialization `%D'; partial specializations " 
!                    "of function templates are not allowed in C++", 
                      declarator); 
          else 
            error ("template-id `%D' in declaration of primary template", 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14971



More information about the Gcc-bugs mailing list