public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++14/lambda] Experimental polymorphic lambda patches
@ 2013-07-01 23:27 Adam Butcher
  2013-07-01 23:27 ` [PATCH 1/4] [lambda] [polymorphic] Support template-parameter-list in lambda-declarator Adam Butcher
                   ` (6 more replies)
  0 siblings, 7 replies; 39+ messages in thread
From: Adam Butcher @ 2013-07-01 23:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill, Adam Butcher

Hi all,

I've finally reworked the generic lambda patches I made back in 2009
(http://gcc.1065356.n5.nabble.com/lambda-Latest-experimental-polymorphic-lambda-patches-tt713016.html)
to apply against GCC's mainline.

The syntaxes demonstrated by the following examples are supported (as
per the previous incarnation) implementing parts of N3559 and N3560.

  1.  [] (auto x, auto& y, auto const& z) { return x + y + z; } 
  2.  [] <typename X, typename Y, typename Z> (X x, Y& y, Z const& z) { return x + y + z; } 
  3.  [] <typename Y> (auto x, Y& y, auto const& z) { return x + y + z; } 

Missing features:

 - Conversion to function pointer of stateless generic lambdas is
   currently unsupported.  Currently a warning is generated for all
   such lambdas at their definition.

Other issues: (see XXX, FIXME, TODO)

  a)  Location of implementation.
  b)  What to do about name mangling?
  c)  Figure out why symtab contains nullptrs.  Maybe related to (b).
  d)  Not behind any -std option.  Should require -std=c++1y or
      -std=gnu++1y.
  e)  Should collect 'auto' parameters during parse and realloc
      template parameter list once at the end of the parameter list
      rather than incrementally.

Any comments appreciated.  Guidance on implementing the conversion
operator for stateless generic lambdas would be useful.  I've made a
few attempts which were lacking!

Cheers,
Adam

Patch summary: (4):
  [lambda] [polymorphic] Support template-parameter-list in
    lambda-declarator.
  [lambda] [polymorphic] Support generic lambdas in templates.
  [lambda] [polymorphic] Infer template parameter from auto used in
    function parameter list.
  [lambda] [polymorphic] [HACK] Avoid crash on symbol table writing when
    generic lambda declared with iostream (or potentially other code)
    included.

 gcc/cp/decl.c      |   1 +
 gcc/cp/mangle.c    |   2 +
 gcc/cp/parser.c    | 246 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 gcc/cp/pt.c        |  10 +++
 gcc/cp/semantics.c |  10 ++-
 gcc/symtab.c       |  18 ++++
 6 files changed, 279 insertions(+), 8 deletions(-)

-- 
1.8.3

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2013-09-04 20:29 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01 23:27 [C++14/lambda] Experimental polymorphic lambda patches Adam Butcher
2013-07-01 23:27 ` [PATCH 1/4] [lambda] [polymorphic] Support template-parameter-list in lambda-declarator Adam Butcher
2013-07-01 23:27 ` [PATCH 2/4] [lambda] [polymorphic] Support generic lambdas in templates Adam Butcher
2013-07-01 23:27 ` [PATCH 3/4] [lambda] [polymorphic] Infer template parameter from auto used in function parameter list Adam Butcher
2013-07-01 23:27 ` [PATCH 4/4] [lambda] [polymorphic] [HACK] Avoid crash on symbol table writing when generic lambda declared with iostream (or potentially other code) included Adam Butcher
2013-07-02  0:01 ` [PATCH] [debug] Added DEBUG_FUNCTION void dump_backtrace Adam Butcher
2013-07-11 17:35 ` [C++14/lambda] Experimental polymorphic lambda patches Jason Merrill
2013-07-12  2:04   ` Gabriel Dos Reis
2013-07-14  9:07     ` [PATCH] [lambda] Extract lambda functions from semantics.c Adam Butcher
2013-07-14 17:30       ` Jason Merrill
2013-09-04  2:33       ` Mike Stump
     [not found]         ` <CAAiZkiDeMcumAPK=Dvvtocufanj9uqFg=T1oj8RnFXY5K6VdMQ@mail.gmail.com>
2013-09-04 17:55           ` Adam Butcher
     [not found]             ` <CAAiZkiBrDFuMOVuYobXPifvVQH=TDw9HZgk9s-A_vK+z7KEPZQ@mail.gmail.com>
2013-09-04 20:29               ` Adam Butcher
2013-07-19  9:01   ` [C++14/lambda/impicit-templates] Experimental polymorphic lambda and implicit function template patches Adam Butcher
2013-07-19  9:01     ` [PATCH 1/3] [lambda] Support template-parameter-list in lambda-declarator Adam Butcher
2013-07-19 17:33       ` Jason Merrill
2013-08-03 13:29         ` [C++14/lambda/impicit-templates] Experimental polymorphic lambda and implicit function template patches Adam Butcher
2013-08-03 13:29           ` [PATCH 4/4] Grammar "it's" to "its" Adam Butcher
2013-08-03 13:36             ` Gabriel Dos Reis
2013-08-03 13:54               ` Adam Butcher
2013-08-03 13:29           ` [PATCH 2/4] [lambda] Support implicit conversion of a stateless generic lambda to a function pointer Adam Butcher
2013-08-03 16:19             ` Jason Merrill
2013-08-04 23:46               ` Adam Butcher
2013-08-05 21:26                 ` Jason Merrill
2013-08-07  7:53                   ` [FIXED] Generic lambda symbol table bug Adam Butcher
2013-08-07 15:59                     ` Jason Merrill
2013-08-07 19:56                       ` Adam Butcher
2013-08-08 22:28                         ` Adam Butcher
2013-08-09  2:01                           ` Jason Merrill
2013-08-09  7:29                             ` Adam Butcher
2013-08-03 13:29           ` [PATCH 3/4] [lambda] Address review comments Adam Butcher
2013-08-03 13:40             ` Gabriel Dos Reis
2013-08-03 13:51               ` Adam Butcher
2013-08-03 13:29           ` [PATCH 1/4] [lambda] Preserve type qualifiers for implicit template parameters Adam Butcher
2013-07-19  9:01     ` [PATCH 3/3] [lambda] [basic-terse-templates] Support using `auto' in a function parameter list to introduce an implicit template parameter Adam Butcher
2013-07-19  9:06     ` [PATCH 2/3] [lambda] Avoid crash on symbol table writing when generic lambda declared with iostream (or potentially other code) included Adam Butcher
2013-08-03 18:38 ` [C++14/lambda] Experimental polymorphic lambda patches Paolo Carlini
2013-08-04 22:52   ` Adam Butcher
2013-08-04 23:02     ` Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).