[cfe-commits] r147533 - in /cfe/trunk/lib: Sema/SemaLookup.cpp Serialization/ASTReaderDecl.cpp
Douglas Gregor
dgregor at apple.com
Fri Jan 13 15:11:01 PST 2012
On Jan 11, 2012, at 12:47 AM, Enea Zaffanella wrote:
> 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.
Fixed in r148154, thanks!
> (Side note: this is maybe also related with PR6298.)
Unfortunately, that's a deeper, longstanding issue.
- Doug
More information about the cfe-commits
mailing list