Re: [PATCH 1/2] ?PR c++/61636

2015-04-20 Thread Marek Polacek
On Sat, Apr 18, 2015 at 06:53:28PM +0100, Adam Butcher wrote: Test like this? /* { dg-do run { target c++14 } } */ /* { dg-final { scan-assembler-not ... } } */ What is this dg-final supposed to do here? Marek

Re: [PATCH 1/2] ?PR c++/61636

2015-04-20 Thread Adam Butcher
On 2015-04-20 11:25, Marek Polacek wrote: On Sat, Apr 18, 2015 at 06:53:28PM +0100, Adam Butcher wrote: Test like this? /* { dg-do run { target c++14 } } */ /* { dg-final { scan-assembler-not ... } } */ What is this dg-final supposed to do here? It was a placeholder for making sure that,

Re: [PATCH 1/2] PR c++/61636

2015-04-19 Thread Adam Butcher
On 2015-04-18 18:53, Adam Butcher wrote: Test like this? /* { dg-do run { target c++14 } } */ /* { dg-final { scan-assembler-not ... } } */ struct X { int f (int, double) { return 255; } static int f (int, int) { return 65535; } auto m1 () { return [=] (auto a) { return f

Re: [PATCH 1/2] PR c++/61636

2015-04-19 Thread Jason Merrill
On 04/19/2015 03:03 PM, Adam Butcher wrote: I think I need to resolve a member call within a generic lambda as if it were not in template context to determine whether it unambiguously resolves to a static member function. If it does, then no capture required. Otherwise, 'this' should be

Re: [PATCH 1/2] PR c++/61636

2015-04-18 Thread Adam Butcher
On 2015-04-17 22:06, Adam Butcher wrote: On 2015-04-17 20:58, Jason Merrill wrote: On 04/09/2015 11:31 PM, Adam Butcher wrote: + /* For generic lambdas, resolve default captured 'this' now. */ This isn't quite right. We don't want to capture 'this' any time we see a member

Re: [PATCH 1/2] PR c++/61636

2015-04-17 Thread Jason Merrill
On 04/09/2015 11:31 PM, Adam Butcher wrote: + /* For generic lambdas, resolve default captured 'this' now. */ + if (processing_template_decl +is_dummy_object (instance) +current_class_type +

Re: [PATCH 1/2] PR c++/61636

2015-04-17 Thread Adam Butcher
On 2015-04-17 20:58, Jason Merrill wrote: On 04/09/2015 11:31 PM, Adam Butcher wrote: + /* For generic lambdas, resolve default captured 'this' now. */ This isn't quite right. We don't want to capture 'this' any time we see a member function call, as overload resolution might

[PATCH 1/2] PR c++/61636 * cp/parser.c (cp_parser_postfix_expression): Resolve default captured 'this' early for generic lambdas.

2015-04-13 Thread Adam Butcher
PR c++/61636 * g++.dg/cpp1y/pr61636.C: New test. --- gcc/cp/parser.c | 16 gcc/testsuite/g++.dg/cpp1y/pr61636.C | 19 +++ 2 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/pr61636.C diff --git