typeck2.c (cxx_incomplete_type_diagnostic): Revert change and check is_overloaded_fn.
authorNathan Sidwell <nathan@acm.org>
Tue, 16 May 2017 16:15:47 +0000 (16:15 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 16 May 2017 16:15:47 +0000 (16:15 +0000)
* typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
check is_overloaded_fn.

From-SVN: r248119

gcc/cp/ChangeLog
gcc/cp/typeck2.c

index 16a6e4c7e2fe93bfb290bd135341c36271b672ed..06bc8b67b6b55606a4534390075f9d9f81ebfaee 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-16  Nathan Sidwell  <nathan@acm.org>
+
+       * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
+       check is_overloaded_fn.
+
 2017-05-16  Martin Liska  <mliska@suse.cz>
 
        * parser.c (cp_lexer_print_token): Add default value for flags
@@ -58,7 +63,7 @@
        (get_first_fn) Document.
        * typeck.c (cp_build_addr_expr_1): Pass arg directly to
        really_overloaded_fn.
-       * typeck2.c (cxx_inomplete_type_diagnostic): Use get_first_fn directly.
+       * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
 
        * cp-tree.h (SCOPE_DEPTH): New.
        * name-lookup.h (is_nested_namespace): Declare.
index b469fdb7b2828d9f3b0c812549c8c42d497e5c08..ff445ca6a0e6ee858adeace0a3684fd04f2d5d35 100644 (file)
@@ -506,7 +506,9 @@ cxx_incomplete_type_diagnostic (location_t loc, const_tree value,
     case OFFSET_TYPE:
     bad_member:
       {
-       tree member = get_first_fn (TREE_OPERAND (value, 1));
+       tree member = TREE_OPERAND (value, 1);
+       if (is_overloaded_fn (member))
+         member = get_first_fn (member);
 
        if (DECL_FUNCTION_MEMBER_P (member)
            && ! flag_ms_extensions)