c++: generic lambdas and local-externs from outer scopes [PR 99030]

Nathan Sidwell nathan@acm.org
Wed Feb 10 13:34:19 GMT 2021


Lambdas	can refer to local externs from	their enclosing	scope.	When
the lambda's generic but the containing function is not a temploid,
we'll never have tsubsted the declaring decl so	won't have a local
specialization.	 But in	that case we can just use the decl we
tsubsting directly -- it's not dependent.

	PR c++/99030
	gcc/cp
         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
         answer if there's no local specialization.
	gcc/testsuite/
         * g++.dg/lookup/pr99030.C: New.

-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr99030.diff
Type: text/x-patch
Size: 1400 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210210/10697d5e/attachment.bin>


More information about the Gcc-patches mailing list