From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17418 invoked by alias); 1 Jul 2011 16:20:03 -0000 Received: (qmail 17361 invoked by uid 22791); 1 Jul 2011 16:20:01 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 16:19:48 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49609] No code emitted for address-taken instances of function templates X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 01 Jul 2011 16:20:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00063.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49609 --- Comment #1 from Jonathan Wakely 2011-07-01 16:19:27 UTC --- The C++ standard lists the contexts in which an overloaded function name can be used without arguments, and reinterpret_cast is not one of them. Based on that, I would think G++ 4.4 was correct to reject the code. I note that clang++ gives the same behaviour as G++ 4.7 (accepts the code but does not instantiate the function template) You can make it work by using an explicit type conversion to the correct type before doing the reinterpret_cast: void *(*my_function_ptr)(void*, void *) = reinterpret_cast( (void*(*)(float*,float*))&(value_convert_function) );