From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21906 invoked by alias); 21 Mar 2013 21:51:52 -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 Received: (qmail 21796 invoked by uid 48); 21 Mar 2013 21:51:06 -0000 From: "gessos.paul at yahoo dot gr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56685] New: default template parameter cannot precede a non-default template parameter in a function Date: Thu, 21 Mar 2013 21:51: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: gessos.paul at yahoo dot gr 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" MIME-Version: 1.0 X-SW-Source: 2013-03/txt/msg01484.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56685 Bug #: 56685 Summary: default template parameter cannot precede a non-default template parameter in a function Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: gessos.paul@yahoo.gr Following code is legal, according to spec, but not compile. f(0) works fine g(0) is the same thing, but not compile. more discussion: http://stackoverflow.com/questions/11684954/can-function-default-template-parameter-be-put-before-non-default-ones ----------------------------------- #include #include #include using namespace std; struct X {}; template void f(const U& m) {} template void g(const U& m) { auto ff = [] () {}; } int main() { f(0); g(0); return 0; }