This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix compile-cplus-types.c build errors
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>, Keith Seitz <keiths at redhat dot com>
- Date: Thu, 30 Aug 2018 09:06:09 -0600
- Subject: Re: [PATCH] Fix compile-cplus-types.c build errors
- References: <1535640184-20543-1-git-send-email-simon.marchi@ericsson.com>
>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
Simon> Fix the third one by comparing to 0 instead. I think the current
Simon> comparison simply uses the wrong enum type. Comparing to 0 seems like
Simon> the right thing to do, because we want to check whether any flags are
Simon> specified.
I think this is fine, but at the same time, it seems reasonable to me to
want to compare an enum flags object against an enumerator from the
underlying type. So maybe enum_flags should have operator== and operator!=.
What do you think of this? I am trying to think of a counter-example
where this would cause problems.
Simon> * compile/compile-cplus-types.c
Simon> (compile_cplus_instance::enter_scope): Take the address of scope
Simon> object.
Simon> (compile_cplus_instance::leave_scope): Likewise.
Simon> (compile_cplus_instance::convert_qualified_base): Compare quals
Simon> to 0.
Looks good.
Tom