This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] get_fns cleanups
- From: Nathan Sidwell <nathan at acm dot org>
- To: Jason Merrill <jason at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 May 2017 12:16:19 -0400
- Subject: Re: [C++ PATCH] get_fns cleanups
- Authentication-results: sourceware.org; auth=none
- References: <fec5d4c9-bd9f-f956-94b7-6b24c62e7e21@acm.org> <CADzB+2=hwtc4fz72dD6G_oX_QPZNXKP4w_6cqSrjaHE+eVgPxw@mail.gmail.com>
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)