c++: is_this_parameter and coroutines proxies

Compiling coroutines/pr95736.C with the implicit constexpr patch broke
because is_this_parameter didn't recognize the coroutines proxy for 'this'.

gcc/cp/ChangeLog:

	* semantics.c (is_this_parameter): Check DECL_HAS_VALUE_EXPR_P
	instead of is_capture_proxy.
This commit is contained in:
Jason Merrill 2021-11-13 17:16:46 -05:00
parent bd95d75f34
commit daa9c6b015

View file

@ -11382,7 +11382,8 @@ is_this_parameter (tree t)
{
if (!DECL_P (t) || DECL_NAME (t) != this_identifier)
return false;
gcc_assert (TREE_CODE (t) == PARM_DECL || is_capture_proxy (t)
gcc_assert (TREE_CODE (t) == PARM_DECL
|| (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t))
|| (cp_binding_oracle && TREE_CODE (t) == VAR_DECL));
return true;
}