-
- Downloads
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.
Showing
- gcc/cp/call.c 1 addition, 1 deletiongcc/cp/call.c
- gcc/cp/cp-tree.h 5 additions, 5 deletionsgcc/cp/cp-tree.h
- gcc/cp/decl.c 11 additions, 8 deletionsgcc/cp/decl.c
- gcc/cp/name-lookup.c 12 additions, 33 deletionsgcc/cp/name-lookup.c
- gcc/cp/parser.c 2 additions, 1 deletiongcc/cp/parser.c
- gcc/cp/pt.c 3 additions, 2 deletionsgcc/cp/pt.c
- gcc/cp/semantics.c 1 addition, 1 deletiongcc/cp/semantics.c
- libcc1/libcp1plugin.cc 1 addition, 1 deletionlibcc1/libcp1plugin.cc
Loading
Please register or sign in to comment