Re: [PATCH 16/22] Class-ify ui_out_level

Antoine Tremblay
2016-11-30T13:47:55Z

Pedro Alves writes:

> 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?

Yes this case yes. I was thinking of
https://sourceware.org/ml/gdb-patches/2016-11/msg00973.html

Also we allow the use of dynamic_cast while GCC doesn't...

I'm sure other things will come up ?