This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77914] Wrong lambda definition accepted
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2017 22:23:49 +0000
- Subject: [Bug c++/77914] Wrong lambda definition accepted
- Auto-submitted: auto-generated
- References: <bug-77914-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77914
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Adam Butcher from comment #4)
> (In reply to Michele Caini from comment #3)
> > (In reply to Jakub Jelinek from comment #1)
> > > Shall we remove that altogether, or just pedwarn on it?
> >
> > I suspect it should be rejected, unless it is an intended extension of the
> > compiler (for which I've not been able to find the docs - in this case, a
> > pedwarn should be emitted at least).
>
> It was an intended extension. Without it, a lambda argument cannot include
> a non-type template parameter or name within its body (without decltype) a
> type inferred from its arguments. Since it does not conflict with the
> standard, it should be acceptable as a GCC extension. I didn't document it
> at the time, however, or pedwarn about it. Possibly at the time it was
> added the standard was still being finalized.
>
> We could leave this issue open to address the docs and pedwarn unless you
> want to drop the feature completely?
I think we should pedwarn; the committee may well add this syntax in the
future.