c++: simplify enclosing_instantiation_of [PR95870]

Comparing DECL_SOURCE_LOCATION like the GCC 11 patch for PR 95870 will also
work for user-defined functions, if we update their location when
instantiating.  Another option would be to use LAMBDA_EXPR_REGEN_INFO for
lambdas, but this way is even simpler.

gcc/cp/ChangeLog:

	PR c++/95870
	* pt.c (enclosing_instantiation_of): Just compare
	DECL_SOURCE_LOCATION.
	(regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1 file changed