This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54104] Parser error for lambda expression if function template has default parameter.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 Jul 2012 09:31:17 +0000
- Subject: [Bug c++/54104] Parser error for lambda expression if function template has default parameter.
- Auto-submitted: auto-generated
- References: <bug-54104-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54104
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-07-27
CC| |jason at gcc dot gnu.org
Ever Confirmed|0 |1
Severity|critical |normal
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-27 09:31:17 UTC ---
I think the code is valid. U doesn't need a default template argument, as per
DR 226 [temp.param]/11 only applies to class templates and alias templates, not
function templates.
G++ accepts the code if the lamdba isn't present or if U has a default
template-argument. It seems that seen_def_arg_p needs to be reset before
parsing the lambda expression.