diff options
author | Jason Merrill <jason@redhat.com> | 2017-08-01 12:38:11 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2017-08-01 12:38:11 -0400 |
commit | 32341663e1ead3f8884add1d09c705d1aa8465ce (patch) | |
tree | f8962760c2772b1068f019ff3fab22bacfdf12a2 /gcc | |
parent | 636730cadd8be7f6280ea673cf44573bd49c37b0 (diff) | |
download | gcc-32341663e1ead3f8884add1d09c705d1aa8465ce.zip gcc-32341663e1ead3f8884add1d09c705d1aa8465ce.tar.gz gcc-32341663e1ead3f8884add1d09c705d1aa8465ce.tar.bz2 |
* decl.c (declare_global_var): Set DECL_CONTEXT.
From-SVN: r250786
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76d1de0..03a9d08 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2017-07-31 Jason Merrill <jason@redhat.com> + + * decl.c (declare_global_var): Set DECL_CONTEXT. + 2017-07-31 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4ec38b8..aab2019 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7583,6 +7583,7 @@ declare_global_var (tree name, tree type) TREE_PUBLIC (decl) = 1; DECL_EXTERNAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1; + DECL_CONTEXT (decl) = FROB_CONTEXT (global_namespace); /* If the user has explicitly declared this variable (perhaps because the code we are compiling is part of a low-level runtime library), then it is possible that our declaration will be merged |