------- Comment #3 from fang at csl dot cornell dot edu 2005-10-06 20:30 ------- Subject: Re: [4.0 regression] lookup fails to match to function call, const-sensitive
> ------- Comment #2 from pinskia at gcc dot gnu dot org 2005-10-06 19:48 > ------- > Here is the reduced testcase: > template <class R, template <class> class P, class T, class A> > inline int mem_fun(R (T::*f)(A), const P<T>& null) {} > > template <class T> class never_ptr {}; > > struct instance_collection_base { > int& pair_dump(int&) const; > static const never_ptr<const instance_collection_base> null; > }; > > int& dump(int& o) { > mem_fun(&instance_collection_base::pair_dump, > instance_collection_base::null); > } > > But I think this is invalid as "const instance_collection_base" is not > the same as instance_collection_base. so T cannot be matched to > "const instance_collection_base" as it was before 4.1.0/4.0.2. > > ICC and Comeau rejects the same code too for the same reason. True, const T != T, but shouldn't const-volatile qualifiers be disregarded when trying to match member functions of T? Perhaps irrelevant, but in the context of my test-case I wanted to be precise about member-function constness. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24243