This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/8] Add gdb_ref_ptr.h
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 02 Dec 2016 10:46:00 -0700
- Subject: Re: [RFA 1/8] Add gdb_ref_ptr.h
- Authentication-results: sourceware.org; auth=none
- References: <1480395946-10924-1-git-send-email-tom@tromey.com> <1480395946-10924-2-git-send-email-tom@tromey.com> <c4f252e9-6184-a364-a1de-e966a16f4017@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> Can you please remove them and see what breaks? Odd that this would be
Pedro> something about Python, given the class is being used in Python code
Pedro> today?
Yes, it's odd. If I comment out the nullptr_t overloads, I get build
failures like:
../../binutils-gdb/gdb/python/py-exitedevent.c:31:20: error: no match for ‘operator==’ (operand types are ‘gdbpy_ref {aka gdb::ref_ptr<_object, gdbpy_ref_policy>}’ and ‘long int’)
if (exited_event == NULL)
^
../../binutils-gdb/gdb/common/gdb_ref_ptr.h:183:13: note: template argument deduction/substitution failed:
In file included from ../../binutils-gdb/gdb/python/py-ref.h:23:0,
from ../../binutils-gdb/gdb/python/py-event.h:27,
from ../../binutils-gdb/gdb/python/py-event.c:21:
../../binutils-gdb/gdb/common/gdb_ref_ptr.h:171:13: note: candidate: template<class T, class POLICY> bool gdb::operator==(const T*, const gdb::ref_ptr<T, POLICY>&)
inline bool operator== (const T *self, const ref_ptr<T, POLICY> &other)
^~~~~~~~
I don't understand why it picks this particular candidate, but
re-reading it now I think my earlier theory is wrong.
Tom