diff mbox

[C++] get_fns cleanups

Message ID f8ab6239-f866-336c-552d-3805053e055b@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 16, 2017, 4:16 p.m. UTC
On 05/16/2017 10:50 AM, Jason Merrill wrote:
> The change to cxx_incomplete_type_diagnostic seems wrong; the member
> might be a data member.

I couldn't get there with a non-overload, but then I couldn't convince 
myself there was no other path.  It's hardly a critical path, so reverted.
diff mbox

Patch

2017-05-16  Nathan Sidwell  <nathan@acm.org>

	* typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
	check is_overloaded_fn.

Index: typeck2.c
===================================================================
--- typeck2.c	(revision 248109)
+++ typeck2.c	(working copy)
@@ -506,7 +506,9 @@  cxx_incomplete_type_diagnostic (location
     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)