diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-09-10 05:38:29 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-09-10 05:45:46 -0700 |
commit | f40866967d69079fdde293feb32d2eb52cb93cc8 (patch) | |
tree | 606b4400706a8a4f96d751e05b3bad2356e67a88 /gcc/cp/call.c | |
parent | d41f8429e9e1b21d862c9a934b129739a3408c79 (diff) | |
download | gcc-f40866967d69079fdde293feb32d2eb52cb93cc8.tar.gz |
c++: DECL_LOCAL_FUNCTION_P -> DECL_LOCAL_DECL_P
Our handling of block-scope extern decls is insufficient for modern
C++, in particular modules, (but also constexprs). We mark such local
function decls, and this patch extends that to marking local var decls
too, so mainly a macro rename. Also, we set this flag earlier, rather
than learning about it when pushing the decl. This is a step towards
handling these properly.
gcc/cp/
* cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
(DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
* decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
(omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
(local_variable_p): Simplify.
* name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
is as expected. Simplify.
(do_pushdecl): Don't set decl_context_in_fn for friends.
(is_local_extern): Simplify.
* call.c (equal_functions): Use DECL_LOCAL_DECL_P.
* parser.c (cp_parser_postfix_expression): Likewise.
(cp_parser_omp_declare_reduction): Likewise.
* pt.c (check_default_tmpl_args): Likewise.
(tsubst_expr): Assert nested reduction function is local.
(type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
* semantics.c (finish_call_expr): Likewise.
libcc1/
* libcp1plugin.cc (plugin_build_call_expr): Use DECL_LOCAL_DECL_P.
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 61bbb38bd2b..5606389f4bd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3631,7 +3631,7 @@ equal_functions (tree fn1, tree fn2) return 0; if (TREE_CODE (fn1) == TEMPLATE_DECL) return fn1 == fn2; - if (DECL_LOCAL_FUNCTION_P (fn1) || DECL_LOCAL_FUNCTION_P (fn2) + if (DECL_LOCAL_DECL_P (fn1) || DECL_LOCAL_DECL_P (fn2) || DECL_EXTERN_C_FUNCTION_P (fn1)) return decls_match (fn1, fn2); return fn1 == fn2; |