class bar { void foo(bool a = 3 < 2, bool b = true) {} }; $ g++ -c ./main.cpp ./main.cpp:2:39: error: redefinition of 'bool b' ./main.cpp:2:39: error: 'bool b' previously declared here (This happends only if the funciton is a member function)
confirmed, this worked with gcc 4.1
Caused by r140120 (i.e. PR37302), guess the declaration is now added during tentative parsing which is then not committed and parsed again differently, defining the parameter again.
Subject: Bug 44991 Author: jason Date: Sun Aug 29 19:24:37 2010 New Revision: 163629 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163629 Log: PR c++/44991 * parser.c (cp_parser_parameter_declaration): Pop parameter decls after tentative parsing. Added: trunk/gcc/testsuite/g++.dg/parse/defarg15.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 44991 Author: jason Date: Mon Aug 30 13:37:34 2010 New Revision: 163643 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163643 Log: PR c++/44991 * parser.c (cp_parser_parameter_declaration): Pop parameter decls after tentative parsing. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/parse/defarg15.C Modified: branches/gcc-4_5-branch/gcc/cp/ChangeLog branches/gcc-4_5-branch/gcc/cp/parser.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Subject: Bug 44991 Author: jason Date: Mon Aug 30 13:38:09 2010 New Revision: 163644 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163644 Log: PR c++/44991 * parser.c (cp_parser_parameter_declaration): Pop parameter decls after tentative parsing. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/parse/defarg15.C Modified: branches/gcc-4_4-branch/gcc/cp/ChangeLog branches/gcc-4_4-branch/gcc/cp/parser.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed.