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

            Bug ID: 128922
           Summary: forward declaration of nested function shadows
                    definition
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: uecker at gcc dot gnu.org
  Target Milestone: ---

We should either reject the forward declaration or merge it, but not shadow the
definition.

int j()
{
        int g()
        {
                return 0;
        }
        auto int g();
        return g();
}

<source>: In function 'j':
<source>:4:13: error: nested function 'g' declared but never defined
    4 |         int g()

Reply via email to