aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-10-01 06:47:36 -0700
committerNathan Sidwell <nathan@acm.org>2020-10-01 06:51:29 -0700
commit80a9c584e339c4f87a3f48ca6397d4a29b7e4ab6 (patch)
tree67fae24b4bde9432389906f10a0cebc3bc872a04 /gcc/tree-ssa-threadedge.c
parent73c977cb0a112ac58fae18af44576ade8ab3aa26 (diff)
downloadgcc-80a9c584e339c4f87a3f48ca6397d4a29b7e4ab6.zip
gcc-80a9c584e339c4f87a3f48ca6397d4a29b7e4ab6.tar.gz
gcc-80a9c584e339c4f87a3f48ca6397d4a29b7e4ab6.tar.bz2
c++: pushdecl_top_level must set context
I discovered pushdecl_top_level was not setting the decl's context, and we ended up with namespace-scope decls with NULL context. That broke modules. Then I discovered a couple of places where we set the context to a FUNCTION_DECL, which is also wrong. AFAICT the literals in question belong in global scope, as they're comdatable entities. But create_temporary would use current_scope for the context before we pushed it into namespace scope. This patch asserts the context is NULL and then sets it to the frobbed global_namespace. gcc/cp/ * name-lookup.c (pushdecl_top_level): Assert incoming context is null, add global_namespace context. (pushdecl_top_level_and_finish): Likewise. * pt.c (get_template_parm_object): Clear decl context before pushing. * semantics.c (finish_compound_literal): Likewise.
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
0 files changed, 0 insertions, 0 deletions