From 32341663e1ead3f8884add1d09c705d1aa8465ce Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 1 Aug 2017 12:38:11 -0400 Subject: [PATCH] * decl.c (declare_global_var): Set DECL_CONTEXT. From-SVN: r250786 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76d1de09c4d..03a9d086408 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2017-07-31 Jason Merrill + + * decl.c (declare_global_var): Set DECL_CONTEXT. + 2017-07-31 Jan Hubicka Martin Liska 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 -- 2.30.2