]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: is_this_parameter and coroutines proxies
authorJason Merrill <jason@redhat.com>
Sat, 13 Nov 2021 22:16:46 +0000 (17:16 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 15 Nov 2021 07:50:26 +0000 (02:50 -0500)
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.

gcc/cp/semantics.c

index 60e0982cc480427f3e835b82eeb9ee00401b3706..15404426bce69f57e1b60bf84c048402df5bf384 100644 (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;
 }