diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-05-19 14:12:14 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-05-19 14:12:14 +0000 |
commit | 6f2f4050aacf448f1e63a844845a1d0e7cde59ca (patch) | |
tree | 34862ee39fd2a98aebffc638e0b600035d0e75bb /gcc/cp/tree.c | |
parent | 546c8974ff51ef7554e18d94177fc953c0e54b95 (diff) | |
download | gcc-6f2f4050aacf448f1e63a844845a1d0e7cde59ca.zip gcc-6f2f4050aacf448f1e63a844845a1d0e7cde59ca.tar.gz gcc-6f2f4050aacf448f1e63a844845a1d0e7cde59ca.tar.bz2 |
call.c (add_list_candidates): Use OVL_FIRST.
* call.c (add_list_candidates): Use OVL_FIRST.
(build_new_method_call_1): Likewise.
* cp-tree.h (OVL_SINGLE_P): New.
(TYPE_HIDDEN_P): New.
* decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
* dump.c (cp_tump_tree): Adjust overload dumping.
* error.c (dump_decl): Use OVL_SINGLE_P, simplify context
printing.
* method.c (lazily_declare_fn): Assert we added it.
* parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
OVL_FIRST.
(cp_parser_template_name): Use lkp_iterator.
* pt.c (begin_template_parm_list): Fixup comment.
(instantiate_class_template_1): Use TYPE_HIDDEN_P.
* tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
(ovl_scope): Use lkp_iterator.
From-SVN: r248285
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e2d0225..8490c81 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2230,7 +2230,11 @@ ovl_iterator::remove_node (tree overload, tree node) singleton overload (and consequently maybe setting its type), because all uses of this function will be followed by inserting a new node that must follow the place we've cut this out from. */ - *slot = OVL_CHAIN (node); + if (TREE_CODE (node) != OVERLOAD) + /* Cloned inherited ctors don't mark themselves as via_using. */ + *slot = NULL_TREE; + else + *slot = OVL_CHAIN (node); return overload; } @@ -2362,9 +2366,12 @@ ovl_scope (tree ovl) if (TREE_CODE (ovl) == TEMPLATE_ID_EXPR) ovl = TREE_OPERAND (ovl, 0); /* Skip using-declarations. */ - while (TREE_CODE (ovl) == OVERLOAD && OVL_USING_P (ovl) && OVL_CHAIN (ovl)) - ovl = OVL_CHAIN (ovl); - return CP_DECL_CONTEXT (OVL_CURRENT (ovl)); + lkp_iterator iter (ovl); + do + ovl = *iter; + while (iter.using_p () && ++iter); + + return CP_DECL_CONTEXT (ovl); } #define PRINT_RING_SIZE 4 |