From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18861 invoked by alias); 3 Dec 2012 15:27:02 -0000 Received: (qmail 17736 invoked by uid 48); 3 Dec 2012 15:26:22 -0000 From: "antoshkka at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55576] New: Fails to compile a call to template member function Date: Mon, 03 Dec 2012 15:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: antoshkka at gmail dot com 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: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2012-12/txt/msg00222.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55576 Bug #: 55576 Summary: Fails to compile a call to template member function Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: antoshkka@gmail.com Created attachment 28860 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D28860 Output of `gcc -v -save-temps -Wall -Wextra main.cpp` When compiling following code: struct factory { template void * apply(void * address) { return new (address) T; } }; template struct apply { template void* operator()(FactoryT const& f, void * address) { return f.template apply(address); } }; int main() { int place; apply()(factory(), &place); return 0; } Tries to instantiate structure `apply` instead of calling a `factory` member function `apply` (prints error: invalid use of =E2=80=98struct apply=E2= =80=99).