public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Lambda templates and implicit function templates.
@ 2013-08-27 19:43 Adam Butcher
  2013-08-27 19:43 ` [PATCH 1/4] Support lambda templates Adam Butcher
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Adam Butcher @ 2013-08-27 19:43 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc-patches, Gabriel Dos Reis, Andrew Sutton, Adam Butcher

Hi Jason,

Here's an updated patch set.  The fully_implicit_function_template_p
field has been moved into cp_parser and the other comments addressed.

I've done some testing with parameter packs also.  They work okay with
the explicit template parameter syntax for lambdas.

Unfortunately, due to errors being thrown 'early' in grokdeclarator, I
haven't been able to get 'auto...' (or reference/qualified variants)
working yet.  I think I need to defer processing the parameter pack
internals of grokdeclarator until I have the synthesized template
parameter (or generate one on the fly in-place --- but that's
returning to the old 'on-demand' implementation which we moved away
from).

I don't know if it's the correct thing to do but the implementation
currently omits the conversion to function pointer operator if the
argument list contains a parameter pack.

One other thing, assuming the 'auto...' syntax can be made to work,
bug 41933 needs to be resolved for the expansion returned by the
generic lambda in N3690 5.1.2.5 to compile.  Currently (transforming
the 'auto&&...' to an explicit '<typename T...> T&&...') appears to
yield the bug.

In particular I get:
  error: expansion pattern ‘ts’ contains no argument packs
  sorry, unimplemented: use of ‘type_pack_expansion’ in template

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41933#c8

You look to have done some work on it.  Any direction as to where to
go from there?  If the solution requires reworking variadics somehow
might that perhaps alleviate my problems implementing 'auto...'?
Wishful thinking probably!

Cheers,
Adam


Patch summary (4):
  Support lambda templates.
  Don't generate lambda conversion op if arglist has parameter pack.
  Support dumping type bindings in lambda diagnostics.
  Support using 'auto' in a function parameter list to introduce an
    implicit template parameter.

 gcc/cp/cp-tree.h    |   2 +
 gcc/cp/decl.c       |   7 +-
 gcc/cp/decl2.c      |   5 +-
 gcc/cp/error.c      |  22 +++---
 gcc/cp/lambda.c     | 115 ++++++++++++++++++++++-----
 gcc/cp/parser.c     | 222 +++++++++++++++++++++++++++++++++++++++++++++++++---
 gcc/cp/parser.h     |   6 ++
 gcc/cp/pt.c         |  39 +++++----
 gcc/cp/type-utils.h |  56 +++++++++++++
 9 files changed, 413 insertions(+), 61 deletions(-)
 create mode 100644 gcc/cp/type-utils.h

-- 
1.8.4

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

end of thread, other threads:[~2013-09-09 14:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27 19:43 Lambda templates and implicit function templates Adam Butcher
2013-08-27 19:43 ` [PATCH 1/4] Support lambda templates Adam Butcher
2013-09-01 20:22   ` Jason Merrill
2013-09-02 18:30     ` Adam Butcher
2013-09-02 18:34       ` Jason Merrill
2013-09-02 21:18         ` Adam Butcher
2013-09-03  3:50           ` Jason Merrill
2013-09-03 19:50             ` Adam Butcher
2013-09-03 21:25               ` Jason Merrill
2013-09-05 19:14                 ` Adam Butcher
2013-09-05 20:53                   ` Adam Butcher
2013-09-09  7:24                     ` Adam Butcher
2013-09-09 15:08                       ` Jason Merrill
2013-08-27 19:43 ` [PATCH 2/4] Don't generate lambda conversion op if arglist has parameter pack Adam Butcher
2013-09-01 20:28   ` Jason Merrill
2013-08-27 19:43 ` [PATCH 4/4] Support using 'auto' in a function parameter list to introduce an implicit template parameter Adam Butcher
2013-09-01 21:20   ` Jason Merrill
2013-09-02 18:45     ` Adam Butcher
2013-08-27 20:03 ` [PATCH 3/4] Support dumping type bindings in lambda diagnostics Adam Butcher
2013-09-01 20:05 ` Lambda templates and implicit function templates Jason Merrill
2013-09-02 18:27   ` Adam Butcher
2013-09-02 18:51     ` Jason Merrill

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).