[cfe-commits] r65373 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp test/Sema/function-redecl.c

Neil Booth neil at daikokuya.co.uk
Mon Feb 23 22:50:45 PST 2009


Douglas Gregor wrote:-

> Author: dgregor
> Date: Mon Feb 23 22:26:15 2009
> New Revision: 65373
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=65373&view=rev
> Log:
> In C, when we see a function declaration within a local scope, export
> that declaration to global scope so that it can be found from other
> scopes. This allows us to diagnose redeclaration errors for external
> declarations across scopes. We also warn when name lookup finds such
> an out-of-scope declaration. This is part of <rdar://problem/6127293>;
> we'll also need to do the same thing for variables.

Cool.  Still misses silly stuff like

void foo (void)
{
  extern int x(void);
  {
    int x;

    {
      extern int x(double);
    }
  }
}

though.

Neil.



More information about the cfe-commits mailing list