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

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 15 23:26:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-04-15 22:50 -------
Confirmed. I assume you had something like this in mind: 
------------------ 
template <typename U, typename V> 
void f(U,V) {}; 
 
template <typename U> 
void f<U,int> (U, int) {}; 
------------------ 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc:5: error: partial specialization `f<U, int>' of function template 
 
Even though I consider myself an experienced C++ user, I have run into 
this before as well, and a description of _why_ this is an error (because 
the standard says it is illegal) would certainly be helpful. I suggest that 
something like 
  partial specializations `...'; partial specializations of function 
  templates are not allowed in C++ 
would be a better wording. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
          Component|debug                       |c++
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-15 22:50:29
               date|                            |
            Summary|error message is correct,   |better error message for
                   |but could be more helpful   |partial specialization of
                   |                            |function templates requested


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



More information about the Gcc-bugs mailing list