summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4ec38b82aa9..aab2019f9cd 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