Skip to content
Snippets Groups Projects
Commit 8ca33347 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

Implement P0018R3, C++17 lambda capture of *this by value as [=,*this]

	Implement P0018R3, C++17 lambda capture of *this by value as [=,*this]
	* parser.c (cp_parser_lambda_introducer): Formatting fix.  Pass
	true instead of false as by_reference_p to add_capture for 'this'.
	Parse '*this' simple-capture.
	* lambda.c (build_capture_proxy): Handle '*this' capture by value.
	(add_capture): Adjust function comment.  For id == this_identifier,
	treat by_reference_p as capturing '*this' by reference, i.e. 'this'
	by value, and !by_reference_p as capturing '*this' by value.
	(add_default_capture): For implicit 'this' capture, always pass
	by_reference_p true rather than false.

	* g++.dg/cpp1z/lambda-this1.C: New test.
	* g++.dg/cpp1z/lambda-this2.C: New test.

From-SVN: r240556
parent 459bcfb0
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment