[C PATCH] Ignore invisible bindings for misspelling hints (PR c/71858)
Marek Polacek
polacek@redhat.com
Thu Jul 14 14:55:00 GMT 2016
On Thu, Jul 14, 2016 at 04:50:16PM +0200, Jakub Jelinek wrote:
> Hi!
>
> As mentioned in the PR, anticipated decls should be ignored from fuzzy
> lookups, unless the corresponding decl is declared first.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2016-07-13 Jakub Jelinek <jakub@redhat.com>
>
> PR c/71858
> * c-decl.c (lookup_name_fuzzy): Ignore binding->invisible.
>
> * gcc.dg/spellcheck-identifiers.c (snprintf): Declare.
> * gcc.dg/spellcheck-identifiers-2.c: New test.
> * gcc.dg/diagnostic-token-ranges.c (nanl): Declare.
> * c-c++-common/attributes-1.c: Adjust dg-prune-output.
>
> --- gcc/c/c-decl.c.jj 2016-06-24 12:59:22.000000000 +0200
> +++ gcc/c/c-decl.c 2016-07-13 22:40:23.410658411 +0200
> @@ -4021,7 +4021,7 @@ lookup_name_fuzzy (tree name, enum looku
> for (c_scope *scope = current_scope; scope; scope = scope->outer)
> for (c_binding *binding = scope->bindings; binding; binding = binding->prev)
> {
> - if (!binding->id)
> + if (!binding->id || binding->invisible)
> continue;
> /* Don't use bindings from implicitly declared functions,
> as they were likely misspellings themselves. */
This is OK as long as David is fine with the testsuite part. Thanks,
Marek
More information about the Gcc-patches
mailing list