This is the mail archive of the gcc@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]

If this code supposed to be well-formed?


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;
}

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