This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 61088


On 05/22/2014 04:27 AM, Paolo Carlini wrote:
lambda-ice7.C:8:9: error: cannot capture by value âaâ of incomplete type
âAâ
[=](){a;};
^

All the carets in your mail are in the first column; is this one in the right place for you?

Let's not print out the expression, we've been moving away from that. Maybe "capture by value of incomplete type 'A'".

OK with that change.

4- Finally, something I noticed while working on add_capture: right above the new check there is:

type = lambda_capture_field_type (initializer, explicit_init_p);
if (by_reference_p)
{
type = build_reference_type (type);
if (!real_lvalue_p (initializer))
error ("cannot capture %qE by reference", initializer);
}

now, interestingly, nothing in the testsuite exercises this error. And, so far, I failed to create a testcase for it. The Standard too doesn't seem to me so clear about that. Ideas?!?

void f()
{
  [&x=1]{}
}

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]