From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1097 invoked by alias); 18 Jul 2006 13:40:23 -0000 Received: (qmail 1077 invoked by uid 48); 18 Jul 2006 13:40:15 -0000 Date: Tue, 18 Jul 2006 13:40:00 -0000 Message-ID: <20060718134015.1076.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/28385] templated function call goes awry In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bangerth at dealii dot org" 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 X-SW-Source: 2006-07/txt/msg01408.txt.bz2 List-Id: ------- Comment #1 from bangerth at dealii dot org 2006-07-18 13:40 ------- (In reply to comment #0) > Everyone knows that in C, "&function_name" and "function_name" are generally > equivalent-- you can write: > func_ptr_type* f = &function_name; > or > func_ptr_type* f = function_name; > > So it is surprising to me that > myFoo(bar); > seems to behave differently than: > myFoo(&bar); The difference is that C++ has references whereas C doesn't. 'bar' has type 'reference to function', whereas '&bar' is 'pointer to function'. W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28385