From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id F2B963857C67; Mon, 15 Nov 2021 07:52:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2B963857C67 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5255] c++: is_this_parameter and coroutines proxies X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: bd95d75f3412e1a7debab7c6c602ba409f274eb5 X-Git-Newrev: daa9c6b015a33fa98af0ee7cd6919120248ab5f9 Message-Id: <20211115075235.F2B963857C67@sourceware.org> Date: Mon, 15 Nov 2021 07:52:35 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 07:52:36 -0000 https://gcc.gnu.org/g:daa9c6b015a33fa98af0ee7cd6919120248ab5f9 commit r12-5255-gdaa9c6b015a33fa98af0ee7cd6919120248ab5f9 Author: Jason Merrill Date: Sat Nov 13 17:16:46 2021 -0500 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. Diff: --- gcc/cp/semantics.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 60e0982cc48..15404426bce 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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; }