On 1/16/19 4:48 PM, Nathan Sidwell wrote:
This PR reports a bug where we select a non-const operator function and then apply it to a const object.  That's happening because the expression 'c[0]' is not dependent, so we figure end up resolving it. But the lambda capture logic doesn't capture 'c' at that point and we have a non-const qualified 'c'.  At instantiation time we do the capture and the by-value lambda results in const-qualified captures.

Jason, the orginal test in process_outer_var_ref looked a little funky -- why not just processing_template_decl? That would satisfy what the comment says it checking.  Anyway changing the test to check DECL's type-dependency makes the right things happen, and a bootstrap passes. Could you review please.

Hmm, I don't remember exactly my rationale for deferring captures within a template, but if this doesn't obviously break anything it seems reasonable. Go ahead.

Jason

Reply via email to