From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2391 invoked by alias); 20 Oct 2012 20:24:36 -0000 Received: (qmail 2356 invoked by uid 48); 20 Oct 2012 20:24:19 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55002] trailing return type is rejected in function signature Date: Sat, 20 Oct 2012 20:24:00 -0000 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: daniel.kruegler at googlemail 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: CC 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" 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-10/txt/msg01841.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55002 Daniel Kr=C3=BCgler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler at | |googlemail dot com --- Comment #2 from Daniel Kr=C3=BCgler 2012-10-20 20:24:19 UTC --- Your issue looks invalid to me, because you are never providing a pointer to function declarator.=20 Lets look first at your simplified example: auto (*ff) -> int (int) This would be an invalid function declarator, because there is (a) no param= eter list and (b) the return type is a function type int(int), which is never possible. I can only assume you mean int f(auto (*ff)(int) -> int) { return ff(1); } and this is accepted.=20 A similar defect is in your original code, where the only valid form would = be template size_t=20=20=20 apply (const T (&A)[N], auto (*f)(const T (&)[N]) -> size_t) { return f(A); } which is also accepted.