-
- Downloads
c++: DECL_BUILTIN_P for builtins
We currently detect builtin decls via DECL_ARTIFICIAL && !DECL_HIDDEN_FUNCTION_P, which, besides being clunky, is a problem as hiddenness is a property of the symbol table -- not the decl being hidden. This adds DECL_BUILTIN_P, which just looks at the SOURCE_LOCATION -- we have a magic one for builtins. One of the consequential changes is to make function-scope omp udrs have function context (needed because otherwise duplicate-decls thinks the types don't match at the point we check). This is also morally better, because that's what they are -- nested functions, stop lying. (That's actually my plan for all DECL_LOCAL_DECL_P decls, as they are distinct decls to the namespace-scope decl they alias.) gcc/cp/ * cp-tree.h (DECL_BUILTIN_P): New. * decl.c (duplicate_decls): Use it. Do not treat omp-udr as a builtin. * name-lookup.c (anticipated_builtin): Use it. (set_decl_context_in_fn): Function-scope OMP UDRs have function context. (do_nonmember_using_decl): Use DECL_BUILTIN_P. * parser.c (cp_parser_omp_declare_reduction): Function-scope OMP UDRs have function context. Assert we never find a valid duplicate. * pt.c (tsubst_expr): Function-scope OMP UDRs have function context. libcc1/ * libcp1plugin.cc (supplement_binding): Use DECL_BULTIN_P.
Showing
- gcc/cp/cp-tree.h 4 additions, 0 deletionsgcc/cp/cp-tree.h
- gcc/cp/decl.c 12 additions, 12 deletionsgcc/cp/decl.c
- gcc/cp/name-lookup.c 9 additions, 6 deletionsgcc/cp/name-lookup.c
- gcc/cp/parser.c 4 additions, 2 deletionsgcc/cp/parser.c
- gcc/cp/pt.c 3 additions, 8 deletionsgcc/cp/pt.c
- libcc1/libcp1plugin.cc 1 addition, 1 deletionlibcc1/libcp1plugin.cc
Loading
Please register or sign in to comment