This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR 27078: fixes duplicate ambiguous reference error messages
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Ollie Wild" <aaw at google dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Jun 2007 09:35:01 +0100
- Subject: Re: PATCH: PR 27078: fixes duplicate ambiguous reference error messages
- References: <65dd6fd50706010003v5a9c573ci9a107c9ac7fe2eff@mail.gmail.com>
On 01/06/07, Ollie Wild <aaw@google.com> wrote:
This patch fixes several redundant "ambiguous reference" error
messages by checking ambiguous_decls after calls to
cp_parser_lookup_name. It also removes the ambiguous_p flag from
struct cp_token. It was not being used consistently, and its
functionality should be handled by tentative parsing anyways.
You need a testcase that failed before the patch and passes after the
patch. Something like this may work. If you can think of any other
testcases, please include them. The more, the better.
// { dg-do compile }
// { dg-options "" }
enum E1 { V };
namespace { enum E2 { V }; }
int foo() { return static_cast<int>(V); } // { dg-bogus "error:
reference to .V. is ambiguous.*error: reference to .V. is ambiguous" }
// { dg-error "error: reference to .V. is ambiguous" "" { target *-*-*} 5 }
Please, check that the testcase actually fails with mainline and
passes with your patch applied.
Cheers,
Manuel