PATCH: PR 27078: fixes duplicate ambiguous reference error messages

Manuel López-Ibáñez lopezibanez@gmail.com
Fri Jun 1 08:35:00 GMT 2007


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



More information about the Gcc-patches mailing list