diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-10-10 14:48:34 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-10-10 14:48:34 +0000 |
commit | a6a5091a56a6f7e7d98643cc14c59313eebf8e6f (patch) | |
tree | 61c6d1773f8c26315268fd9e5db043f8db60a089 /gcc | |
parent | 2fe1a1b888e204fd0ccc4e9c96b7065344e879aa (diff) | |
download | gcc-a6a5091a56a6f7e7d98643cc14c59313eebf8e6f.zip gcc-a6a5091a56a6f7e7d98643cc14c59313eebf8e6f.tar.gz gcc-a6a5091a56a6f7e7d98643cc14c59313eebf8e6f.tar.bz2 |
[C++ PATCH] set_global_binding tweak
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00592.html
* name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
From-SVN: r253587
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 21 |
2 files changed, 10 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6c92e1b..082327e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2017-10-10 Nathan Sidwell <nathan@acm.org> + + * name-lookup.c (set_global_binding): Don't deal with STAT_HACK. + 2017-10-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/47791 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index a3da34d..ae30cf9 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4858,22 +4858,13 @@ set_global_binding (tree decl) bool subtime = timevar_cond_start (TV_NAME_LOOKUP); tree *slot = find_namespace_slot (global_namespace, DECL_NAME (decl), true); - tree old = MAYBE_STAT_DECL (*slot); - if (!old) - *slot = decl; - else if (old == decl) - ; - else if (!STAT_HACK_P (*slot) - && TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)) - *slot = stat_hack (old, decl); - else if (!STAT_HACK_P (*slot) - && TREE_CODE (old) == TYPE_DECL && DECL_ARTIFICIAL (old)) - *slot = stat_hack (decl, old); - else - /* The user's placed something in the implementor's - namespace. */ - diagnose_name_conflict (decl, old); + if (*slot) + /* The user's placed something in the implementor's namespace. */ + diagnose_name_conflict (decl, MAYBE_STAT_DECL (*slot)); + + /* Force the binding, so compiler internals continue to work. */ + *slot = decl; timevar_cond_stop (TV_NAME_LOOKUP, subtime); } |