Hello,
Correct me if I'm wrong, but before the function checks for virtual
bases, an if-statement checks for extra_warnings on line 6049(when my
patch is applied). The check was there before I made my changes, and
my test fails
without -Wextra. Below is the code above the warning call:
if (extra_warnings)
for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0;
vec_safe_iterate (vbases, i, &binfo); i++)
{
basetype = BINFO_TYPE (binfo);
Unless I'm mistaken and you meant for me to check for extra_warnings
again in the if-statement directly above the warning call.
Thank you,
Matthew Beliveau
On Tue, Jun 11, 2019 at 12:43 AM Jason Merrill <[email protected]> wrote:
>
> On 6/10/19 12:02 PM, Matthew Beliveau wrote:
> > if (!uniquely_derived_from_p (basetype, t))
> > - warning (OPT_Wextra, "virtual base %qT inaccessible in %qT due "
> > - "to ambiguity", basetype, t);
> > + warning (OPT_Winaccessible_base, "virtual base %qT inaccessible in "
> > + "%qT due to ambiguity", basetype, t);
>
> You mentioned using -Wextra for this message, and you have a testcase
> for it, but here you remove the only connection between this message and
> -Wextra: with this patch, the virtual base warning will be enabled by
> default. Perhaps you want to check extra_warnings in the if condition?
>
> Jason