[PATCH] Reject ambiguous C++ field accesses

Gary Benson gbenson@redhat.com
Fri Aug 28 14:38:59 GMT 2020


Pedro Alves wrote:
> An ambiguous access is now an error instead of a warning, and also
> GDB shows you the all candidates, like:
> 
>  (gdb) print x.x
>  Request for member 'x' is ambiguous in type 'X'. Candidates are:
>    'int A1::x' (X -> A1)
>    'int A2::x' (X -> A2)
>  (gdb) print j.x
>  Request for member 'x' is ambiguous in type 'J'. Candidates are:
>    'int A1::x' (J -> K -> A1)
>    'int A1::x' (J -> L -> A1)

That's really nice, thanks for doing this!

I replied with a comment tweak in another message, but other than
that and the things Luis found, LGTM.

Thanks,
Gary

-- 
Gary Benson - he / him / his
Principal Software Engineer, Red Hat



More information about the Gdb-patches mailing list