aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-05-10 20:53:32 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-05-10 20:53:32 +0000
commit3aa0a770a4b1368a9f2ccc262f483cc811ca9331 (patch)
treefbe41cbe805461c2ec49d31df428f83f0824db1d /gcc
parent3dd836179aa32c3ded97ded16bb24305cefc43b0 (diff)
downloadgcc-3aa0a770a4b1368a9f2ccc262f483cc811ca9331.zip
gcc-3aa0a770a4b1368a9f2ccc262f483cc811ca9331.tar.gz
gcc-3aa0a770a4b1368a9f2ccc262f483cc811ca9331.tar.bz2
class.c (handle_using_decl): Always use OVL_CURRENT.
* class.c (handle_using_decl): Always use OVL_CURRENT. (resolve_address_of_overloaded_function): Move iterator decl into for scope. Don't strip anticipated decls here. From-SVN: r247864
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/class.c53
2 files changed, 25 insertions, 32 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c0bba2a..392323d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2017-05-10 Nathan Sidwell <nathan@acm.org>
+ * class.c (handle_using_decl): Always use OVL_CURRENT.
+ (resolve_address_of_overloaded_function): Move iterator decl into
+ for scope. Don't strip anticipated decls here.
+
* pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
printing.
(print_candidates): Adjust.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f8e4e1f..15b583a 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1359,8 +1359,7 @@ handle_using_decl (tree using_decl, tree t)
tf_warning_or_error);
if (old_value)
{
- if (is_overloaded_fn (old_value))
- old_value = OVL_CURRENT (old_value);
+ old_value = OVL_CURRENT (old_value);
if (DECL_P (old_value) && DECL_CONTEXT (old_value) == t)
/* OK */;
@@ -1384,7 +1383,7 @@ handle_using_decl (tree using_decl, tree t)
{
error ("%q+D invalid in %q#T", using_decl, t);
error (" because of local method %q+#D with same name",
- OVL_CURRENT (old_value));
+ old_value);
return;
}
}
@@ -8184,39 +8183,29 @@ resolve_address_of_overloaded_function (tree target_type,
if we're just going to throw them out anyhow. But, of course, we
can only do this when we don't *need* a template function. */
if (!template_only)
- {
- tree fns;
-
- for (fns = overload; fns; fns = OVL_NEXT (fns))
- {
- tree fn = OVL_CURRENT (fns);
-
- if (TREE_CODE (fn) == TEMPLATE_DECL)
- /* We're not looking for templates just yet. */
- continue;
+ for (tree fns = overload; fns; fns = OVL_NEXT (fns))
+ {
+ tree fn = OVL_CURRENT (fns);
- if ((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
- != is_ptrmem)
- /* We're looking for a non-static member, and this isn't
- one, or vice versa. */
- continue;
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ /* We're not looking for templates just yet. */
+ continue;
- /* Ignore functions which haven't been explicitly
- declared. */
- if (DECL_ANTICIPATED (fn))
- continue;
+ if ((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE) != is_ptrmem)
+ /* We're looking for a non-static member, and this isn't
+ one, or vice versa. */
+ continue;
- /* In C++17 we need the noexcept-qualifier to compare types. */
- if (flag_noexcept_type)
- maybe_instantiate_noexcept (fn);
+ /* In C++17 we need the noexcept-qualifier to compare types. */
+ if (flag_noexcept_type)
+ maybe_instantiate_noexcept (fn);
- /* See if there's a match. */
- tree fntype = static_fn_type (fn);
- if (same_type_p (target_fn_type, fntype)
- || fnptr_conv_p (target_fn_type, fntype))
- matches = tree_cons (fn, NULL_TREE, matches);
- }
- }
+ /* See if there's a match. */
+ tree fntype = static_fn_type (fn);
+ if (same_type_p (target_fn_type, fntype)
+ || fnptr_conv_p (target_fn_type, fntype))
+ matches = tree_cons (fn, NULL_TREE, matches);
+ }
/* Now, if we've already got a match (or matches), there's no need
to proceed to the template functions. But, if we don't have a