[cfe-commits] r147533 - in /cfe/trunk/lib: Sema/SemaLookup.cpp Serialization/ASTReaderDecl.cpp

Enea Zaffanella zaffanella at cs.unipr.it
Wed Jan 11 00:47:26 PST 2012

Il 04/01/2012 17:44, Douglas Gregor ha scritto:
> Author: dgregor
> Date: Wed Jan  4 10:44:10 2012
> New Revision: 147533
> URL: http://llvm.org/viewvc/llvm-project?rev=147533&view=rev
> Log:
> Implement declaration merging for typedefs loaded from disjoint
> modules, so long as the typedefs refer to the same underlying
> type. This ensures that the typedefs end up in the same redeclaration
> chain.
> To test this, fix name lookup for C/Objective-C to properly deal with
> multiple declarations with the same name in the same scope.

Hi Douglas.

It seems that this commit is causing a spurious parse error with the
following C testcase:

$ cat bug.c
int n;
void foo(int n, int (*array)[n]);

$ clang -fsyntax-only bug.c
bug.c:2:30: error: reference to 'n' is ambiguous
void foo(int n, int (*array)[n]);
bug.c:2:14: note: candidate found by name lookup is 'n'
void foo(int n, int (*array)[n]);
bug.c:1:5: note: candidate found by name lookup is 'n'
int n;
1 error generated.

(Side note: this is maybe also related with PR6298.)


More information about the cfe-commits mailing list