If this code supposed to be well-formed?
Olivier Galibert
galibert@pobox.com
Wed Jan 17 07:33:00 GMT 2001
Because if yes then gcc 2.95.2 has a bug, and it could be used as a
test case. The standard is unclear for me in this aspect.
galibert@zalem:~/wk #4 >g++ -O9 -Wall -g test.cc -o test
test.cc: In function `int main()':
test.cc:12: no matching function for call to `f (vector<A *,allocator<A *> > &, B *)'
test.cc:
#include <vector>
class A {};
class B : public A {};
template <typename T> void f(std::vector<T *> v, T *e) {}
int main()
{
std::vector<A *> a_v;
B b;
f(a_v, &b);
return 0;
}
More information about the Gcc
mailing list