This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 16/22] Class-ify ui_out_level
On 11/30/2016 12:40 PM, Antoine Tremblay wrote:
> Note that in the discussion I argued that it would be a good idea to
> keep it for single argument constructors, but that I though that there
> was little chance of confusion for multiple argument constructors like:
>
> ui_out_table (int entry_level, int nr_cols, const std::string &id)
Yeah, unless all the arguments except the first are
defaulted, like:
ui_out_table (int entry_level, int nr_cols = 0, const std::string &id = "")
then it's effectively the same as single-argument constructor, and
allows implicit conversion from int.
There's at least one such case in the series:
ui_out (ui_out_impl_base *impl, int flags = 0);
Maintly harmless, given the types involved, but still I'd
think it better to be explicit.
> (See: https://gcc.gnu.org/codingconventions.html#Conversions)
>
> I'm starting to think we need to document these things as the GCC coding
> conventions may not be exactly what we want and reading the ML there's
> more and more questions about this...
In this case it looks like it's documented?
Thanks,
Pedro Alves