This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3] Support lambda templates.
- From: Adam Butcher <adam at jessamine dot co dot uk>
- To: Jason Merrill <jason at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- Date: Tue, 13 Aug 2013 00:52:35 +0100
- Subject: Re: [PATCH 1/3] Support lambda templates.
- References: <1376250573-13753-1-git-send-email-adam at jessamine dot co dot uk> <1376250573-13753-2-git-send-email-adam at jessamine dot co dot uk> <520903A7 dot 8040704 at redhat dot com>
On 12.08.2013 16:47, Jason Merrill wrote:
On 08/11/2013 03:49 PM, Adam Butcher wrote:
+ if (cxx_dialect < cxx1y || flag_iso)
+ cp_parser_error (parser,
+ "lambda templates are only available with "
+ "-std=gnu++1y");
Normally we only use flag_iso to disable extensions that can change
the meaning of conforming code, which I don't think is the case here.
For pure extensions, we prefer to use a pedwarn.
Okay. Though I'm not sure how to implement exactly what we discussed
before with pedwarn. Namely:
On 07.08.2013 16:59, Jason Merrill wrote:
On 08/07/2013 03:52 AM, Adam Butcher wrote:
I'm not sure which dialect guards to put these features behind
though.
Strictly:
a) Generic lambdas created fully implicitly via 'auto params'
should be
accepted with -std=c++1y and -std=gnu++1y since it is actually
spec'd by
the draft.
b) Generic lambdas created with an explicit template parameter
list should be
accepted with -std=gnu++1y only.
c) Generalized implicit function templates should be accepted by
-std=gnu++1y
only.
This makes sense to me. Or perhaps add (c) to the concepts lite
flag, when there is one.
Presumably with pedwarn it would need to be relaxed to simply
"accepted with -std=c++1y or -std=gnu++1y"
for all? flag_iso was the only thing I could find to discriminate
between gnu++1y
and c++1y?
+ if (!DECL_TEMPLATE_INFO (decl) || DECL_TEMPLATE_RESULT
+ (DECL_TI_TEMPLATE (decl)) != decl)
This needs reformatting so that the arguments to a macro aren't to
the left of the macro name.
Done.
Adam