From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30144 invoked by alias); 6 Oct 2005 21:28:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30134 invoked by alias); 6 Oct 2005 21:28:26 -0000 Date: Thu, 06 Oct 2005 21:28:00 -0000 Message-ID: <20051006212826.30133.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/24243] [4.0 regression] lookup fails to match to function call, const-sensitive In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fang at csl dot cornell dot edu" X-SW-Source: 2005-10/txt/msg00713.txt.bz2 List-Id: ------- Comment #4 from fang at csl dot cornell dot edu 2005-10-06 21:28 ------- Subject: Re: [4.0 regression] lookup fails to match to function call, const-sensitive Something else puzzling to me, that I noticed from your reduction: Why is the compiler always matching the non-const version of mem_fun, when the member-function I'm passing in (pair_dump) is const? Isn't the const a closer match? In fact, if I remove the non-const mem_fun() definition, then I get "no match found" from g++-3.3 to 4.0 -- doesn't even accept the const version. I've seen some old PRs on this matter, but don't recall what their resolution was. > mem_fun(&instance_collection_base::pair_dump, > instance_collection_base::null); // prefers this: template class P, class T, class A> inline mem_fun1_p_t mem_fun(R (T::*f)(A), const P& null) { return mem_fun1_p_t(f); } // over this: template class P, class T, class A> inline const_mem_fun1_p_t mem_fun(R (T::*f)(A) const, const P& null) { return const_mem_fun1_p_t(f); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24243