This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] get_fns cleanups


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.

--
Nathan Sidwell
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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]