This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Mikhail Maltsev <maltsevm at gmail dot com>
- Cc: Christophe Lyon <christophe dot lyon at linaro dot org>, Jason Merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gnu dot org>, Marek Polacek <polacek at redhat dot com>
- Date: Fri, 26 Jun 2015 10:58:54 +0100
- Subject: Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- Authentication-results: sourceware.org; auth=none
- References: <553CC7D2 dot 5050708 at gmail dot com> <558444DE dot 3070204 at redhat dot com> <5584B276 dot 1090901 at gmail dot com> <55883EE5 dot 50201 at redhat dot com> <CAKdteOYV4kPqq8ADKNf2d6F+yZb23PM5An_O6OuDcE_d0OfRYg at mail dot gmail dot com> <558B12F2 dot 7000602 at gmail dot com>
On Wed, Jun 24, 2015 at 09:28:34PM +0100, Mikhail Maltsev wrote:
> On 06/24/2015 06:52 PM, Christophe Lyon wrote:
> > Hi Mikhail,
> >
> > In the gcc-5-branch, I can see that your new inhibit-warn-2.C test
> > fails (targets ARM and AArch64).
> >
> > I can see this error message in g++.log:
> > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:
> > In function 'void fn1()':
> > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:29:3:
> > error: 'typename A<(F<typename C< <template-parameter-1-1>
> >> ::type>::value || B:: value)>::type D::operator=(Expr) [with Expr =
> > int; typename A<(F<typename C< <template-parameter-1-1>
> >> ::type>::value || B:: value)>::type = int]' is private
> > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:35:7:
> > error: within this context
> >
> > Christophe.
> >
> Oops. Sorry for that, it seems that I messed up with my testing box and
> the backport did not actually get regtested :(.
>
> The problem is caused by difference in wording of diagnostics. GCC 6
> gives an error on line 35 and a note on line 29:
>
> $ ./cc1plus ~/gcc/src/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
> void fn1()
> /home/miyuki/gcc/src/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:35:7:
> error: 'typename A<(F<typename C< <template-parameter-1-1>
> >::type>::value || B:: value)>::type D::operator=(Expr) [with Expr =
> int; typename A<(F<typename C< <template-parameter-1-1> >::type>::value
> || B:: value)>::type = int]' is private within this context
> opt = 0;
> /home/miyuki/gcc/src/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:29:3:
> note: declared private here
> operator=(Expr);
>
> GCC 5 gives two errors:
>
> /home/miyuki/gcc/src/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:29:3:
> error: 'typename A<(F<typename C< <template-parameter-1-1>
> >::type>::value || B:: value)>::type D::operator=(Expr) [with Expr =
> int; typename A<(F<typename C< <template-parameter-1-1> >::type>::value
> || B:: value)>::type = int]' is private
> operator=(Expr);
> /home/miyuki/gcc/src/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C:35:7:
> error: within this context
> opt = 0;
>
> It can probably be fixed like this:
>
> diff --git a/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
> b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
> index cb16b4c..f658c1d 100644
> --- a/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
> +++ b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
> @@ -26,11 +26,11 @@ class D
> {
> template <class Expr>
> typename A<F<typename C<Expr>::type>::value || B::value>::type
> - operator=(Expr); // { dg-message "declared" }
> + operator=(Expr); // { dg-message "private" }
> };
>
> void fn1()
> {
> D opt;
> - opt = 0; // { dg-error "private" }
> + opt = 0; // { dg-error "this context" }
> }
>
> But I am not sure, what should I do in this case. Maybe it is better to
> remove the failing testcase from GCC 5 branch (provided that
> inhibit-warn-1.C tests a fix for the same bug and does not fail)?
Your fix looks sensible to me, and I'd like to see it applied before
the 5.2 cut. Hopefully someone with the authority to OK the fixup will
be along shortly!
Thanks,
James
- References:
- Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1
- Re: [Patch, C++, PR65882] Check tf_warning flag in build_new_op_1