This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/21930: Conversions in diagnostics
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 13 Jun 2005 02:38:07 +0200
- Subject: Re: [PATCH] PR c++/21930: Conversions in diagnostics
- References: <Pine.LNX.4.44.0506121638160.17043-100000@www.eyesopen.com>
Roger Sayle <roger@eyesopen.com> writes:
| > I'll follow up with a patch that reduces the noise.
| > Is there a way to tell from an CONVERT_EXPR whether it is explicit or
| > front-end generated?
|
| Not that I know of. It might be sufficient to determine whether the
| cast is required for correctness, or perhaps even eliminate it from
| the trees generated by the C++ front-end if it isn't. For the former,
| using STRIP_NOPS on the operand of the first cast may be sufficient.
OK, thanks.
| > | template<int N>
| > | void foo(const A<N> &a)
| > | { -A<N>(a); } // { dg-error "\\(\\(const A<0>\\*\\)a\\)" "" }
| >
| > I think, you should just test for "-"...
|
| The intention was to add a test that passed after this patch but
| failed without it. i.e. I wanted to explicitly test whether the
| CONVERT_EXPR was handled and that it didn't generate a unary plus.
| Testing for just "-" doesn't verify that the PR remains resolved.
|
| If it's OK with you, I'll go ahead and check in the testcase as
| written, and you can adjust the regular expression when you apply
| the follow-up "noise reduction" patch, you describe above?
yes, that is fine.
Thanks,
-- Gaby