diff options
author | Jason Merrill <jason@redhat.com> | 2020-10-01 10:08:58 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-10-02 11:21:28 +0200 |
commit | b6158faacbfb7d24a1d25b3774bc4338dd849480 (patch) | |
tree | 504ac11d39caf4dcd7cd038bdda69ec153d42e18 /gcc/cp/lambda.c | |
parent | 6a0423c52ef56d6fc2e0392b91bf22941fdeb0db (diff) | |
download | gcc-b6158faacbfb7d24a1d25b3774bc4338dd849480.zip gcc-b6158faacbfb7d24a1d25b3774bc4338dd849480.tar.gz gcc-b6158faacbfb7d24a1d25b3774bc4338dd849480.tar.bz2 |
c++: Move CALL_FROM_NEW_OR_DELETE_P to tree.h
As discussed with richi, we should be able to use TREE_PROTECTED for this
flag, since CALL_FROM_THUNK_P will never be set on a call to an operator new
or delete.
2020-10-01 Jason Merril <jason@redhat.com>
gcc/cp/ChangeLog:
* lambda.c (call_from_lambda_thunk_p): New.
* cp-gimplify.c (cp_genericize_r): Use it.
* pt.c (tsubst_copy_and_build): Use it.
* typeck.c (check_return_expr): Use it.
* cp-tree.h: Declare it.
(CALL_FROM_NEW_OR_DELETE_P): Move to gcc/tree.h.
gcc/ChangeLog:
* tree.h (CALL_FROM_NEW_OR_DELETE_P): Move from cp-tree.h.
* tree-core.h: Document new usage of protected_flag.
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 07a5401..1a1647f 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -1325,6 +1325,13 @@ lambda_static_thunk_p (tree fn) && LAMBDA_TYPE_P (CP_DECL_CONTEXT (fn))); } +bool +call_from_lambda_thunk_p (tree call) +{ + return (CALL_FROM_THUNK_P (call) + && lambda_static_thunk_p (current_function_decl)); +} + /* Returns true iff VAL is a lambda-related declaration which should be ignored by unqualified lookup. */ |