diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-11-07 16:28:46 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-11-07 16:28:46 +0000 |
commit | 72a7649aa53aa210bbe0d89f1ee083f7fcfc61d6 (patch) | |
tree | 6e9f9f904042185d9fb6a040f4afb19406cf0e66 /gcc/cp/tree.c | |
parent | 38f54eec0becb68f4d7924327a9c368d9d27cd8f (diff) | |
download | gcc-72a7649aa53aa210bbe0d89f1ee083f7fcfc61d6.tar.gz |
[PR C++/87904] lookup ICE
https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00468.html
PR c++/87904
* cp-tree.h (struct tree_overload): Fix comment.
* tree.c (ovl_iterator::reveal_node): Propagate OVL_DEDUP_P.
PR c++/87904
* g++.dg/lookup/pr87904.C: New.
From-SVN: r265879
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e9db3ea85c5..5e21fce54a8 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2261,13 +2261,17 @@ ovl_iterator::reveal_node (tree overload, tree node) OVL_HIDDEN_P (node) = false; if (tree chain = OVL_CHAIN (node)) - if (TREE_CODE (chain) == OVERLOAD - && (OVL_USING_P (chain) || OVL_HIDDEN_P (chain))) + if (TREE_CODE (chain) == OVERLOAD) { - /* The node needs moving, and the simplest way is to remove it - and reinsert. */ - overload = remove_node (overload, node); - overload = ovl_insert (OVL_FUNCTION (node), overload); + if (OVL_HIDDEN_P (chain)) + { + /* The node needs moving, and the simplest way is to remove it + and reinsert. */ + overload = remove_node (overload, node); + overload = ovl_insert (OVL_FUNCTION (node), overload); + } + else if (OVL_DEDUP_P (chain)) + OVL_DEDUP_P (node) = true; } return overload; } |