https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71858

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- 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.  */

indeed fixes this.  Well, it suggests:
pr71858.c: In function ‘main’:
pr71858.c:4:10: warning: implicit declaration of function ‘bar’; did you mean
‘char’? [-Wimplicit-function-declaration]
   return bar ();
          ^~~
          char
instead.  Which actually also isn't a very good suggestion for C (unlike C++),
it would be useful to consider only FUNCTION_DECLs in this case.

Reply via email to