This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54104] Parser error for lambda expression if function template has default parameter.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]