This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2004 13:48:44 -0000
- Subject: [Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition
- References: <20040824124058.17166.guillaume.melquiond@ens-lyon.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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