Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-11 Thread Martin Sebor
On 6/11/19 7:59 AM, Matthew Beliveau wrote: 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.

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-11 Thread Marek Polacek
On Tue, Jun 11, 2019 at 10:33:07AM -0400, Jason Merrill wrote: > On 6/11/19 9:59 AM, Matthew Beliveau wrote: > > 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

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-11 Thread Jason Merrill
On 6/11/19 9:59 AM, Matthew Beliveau wrote: 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

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-11 Thread Matthew Beliveau
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

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Jason Merrill
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

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Matthew Beliveau
Hello, i changed the doc/invoke.texi like you suggested. Let me know If I missed anything! Thank you, Matthew Beliveau On Mon, Jun 10, 2019 at 11:39 AM Martin Sebor wrote: > > On 6/7/19 2:10 PM, Matthew Beliveau wrote: > > This patch adds a new warning option: Winaccessible-base, so that > >

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Martin Sebor
On 6/7/19 2:10 PM, Matthew Beliveau wrote: This patch adds a new warning option: Winaccessible-base, so that users are able to selectively control the warning. The warning is enabled by default; however, for the virtual bases' warning, it only triggers with -Wextra flag. With few exceptions

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Marek Polacek
On Mon, Jun 10, 2019 at 10:19:51AM -0400, Matthew Beliveau wrote: > Hello, > > I've changed the name of warn_about_ambiguous_bases to > maybe_warn_about_inaccessible_bases. > > I've attached the new patch below. > > Best, > Matthew Beliveau > > On Fri, Jun 7, 2019 at 4:42 PM Paolo Carlini

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Matthew Beliveau
Hello, I've changed the name of warn_about_ambiguous_bases to maybe_warn_about_inaccessible_bases. I've attached the new patch below. Best, Matthew Beliveau On Fri, Jun 7, 2019 at 4:42 PM Paolo Carlini wrote: > > Hi, > > On 07/06/19 22:31, Marek Polacek wrote: > > On Fri, Jun 07, 2019 at

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-07 Thread Paolo Carlini
Hi, On 07/06/19 22:31, Marek Polacek wrote: On Fri, Jun 07, 2019 at 10:20:02PM +0200, Paolo Carlini wrote: Hi, On 07/06/19 22:10, Matthew Beliveau wrote: @@ -6025,6 +6025,10 @@ warn_about_ambiguous_bases (tree t) Just a nit, but it seems weird to me that the function implementing

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-07 Thread Marek Polacek
On Fri, Jun 07, 2019 at 10:20:02PM +0200, Paolo Carlini wrote: > Hi, > > On 07/06/19 22:10, Matthew Beliveau wrote: > > @@ -6025,6 +6025,10 @@ warn_about_ambiguous_bases (tree t) > > Just a nit, but it seems weird to me that the function implementing > warn_inaccessible_base is named

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-07 Thread Paolo Carlini
Hi, On 07/06/19 22:10, Matthew Beliveau wrote: @@ -6025,6 +6025,10 @@ warn_about_ambiguous_bases (tree t) Just a nit, but it seems weird to me that the function implementing warn_inaccessible_base is named warn_about_ambiguous_bases. Paolo.

[C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-07 Thread Matthew Beliveau
This patch adds a new warning option: Winaccessible-base, so that users are able to selectively control the warning. The warning is enabled by default; however, for the virtual bases' warning, it only triggers with -Wextra flag. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2019-06-07