This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition


------- Additional Comments From bangerth at dealii dot org  2004-08-24 13:48 -------
Here is a redux: 
----------------- 
#include <vector> 
#include <algorithm> 
 
enum {C = ' '}; 
 
void foo() { 
  std::vector<char> show_info_about; 
  std::vector<char>::iterator 
    b = show_info_about.begin(), 
    e = show_info_about.end(); 
  std::remove(b, e, C); 
} 
------------------------ 
(Note that in the original testcase, gamemap::TERRAIN is char, and  
gamemap::VOID_TERRAIN is of enum type.) 
 
This doesn't compile with 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc  
x.cc: In function `void foo()': 
x.cc:11: error: cannot convert `__gnu_cxx::__normal_iterator<char*, 
std::vector<char, std::allocator<char> > >' to `const char*' for argument `1' 
to `int remove(const char*)' 
 
I am presently surprised that we don't match the std::remove (It, It, _T) 
template, and that the compiler rather wants to do the stdio remove(char*) 
function instead. icc compiles this cleanly. 
 
Maybe someone else wants to comment, I have too much to do today to 
investigate this fully. 
 
W. 
 

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]