diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-28 19:01:13 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-28 19:01:13 +0000 |
commit | 3ae3cb42eba0091e719425ce61d3010b5cdbd430 (patch) | |
tree | b72de2324ca719d4d3a1fc4ddc1c350892ee00d7 /gcc/cp/cvt.c | |
parent | dd9bf0b587e8fef5079d25b4928ed52548df7ada (diff) | |
download | gcc-3ae3cb42eba0091e719425ce61d3010b5cdbd430.tar.gz |
* cvt.c (cp_get_callee): New.
* constexpr.c (get_function_named_in_call): Use it.
* cxx-pretty-print.c (postfix_expression): Use it.
* except.c (check_noexcept_r): Use it.
* method.c (check_nontriv): Use it.
* tree.c (build_aggr_init_expr): Use it.
* cp-tree.h: Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235596 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 0d1048cd7fe..8c9d78b641c 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -904,6 +904,20 @@ ocp_convert (tree type, tree expr, int convtype, int flags, return error_mark_node; } +/* If CALL is a call, return the callee; otherwise null. */ + +tree +cp_get_callee (tree call) +{ + if (call == NULL_TREE) + return call; + else if (TREE_CODE (call) == CALL_EXPR) + return CALL_EXPR_FN (call); + else if (TREE_CODE (call) == AGGR_INIT_EXPR) + return AGGR_INIT_EXPR_FN (call); + return NULL_TREE; +} + /* When an expression is used in a void context, its value is discarded and no lvalue-rvalue and similar conversions happen [expr.static.cast/4, stmt.expr/1, expr.comma/1]. This permits dereferencing an incomplete type |