In http://reviews.llvm.org/D10187#184399, @rsmith wrote:
> I think the right way to handle this would be to filter out declarations that
> are neither `FunctionDecl`s nor `VarDecl`s after performing the lookup.
> (According to the specification, we should also filter out declarations with
> internal linkage.)
OK -- I did as you suggested. Please review updated patch.
> We should also filter out internal-linkage declarations and non-TU-scope
> declarations when we perform the deferred handling of
> `ExtnameUndeclaredIdentifiers` in `ActOnVariableDeclarator` and
> `ActOnFunctionDeclarator`.
This probably belongs to a separate patch (for starters, I don't have a test
demonstrating that compiler is currently acting incorrectly).
> That said, I'm not sure why your testcase was failing -- `LookupSingleName`
> in `LookupOrdinaryName` mode in C should not find tag names, so we should
> have deferred adding the attribute already. Is a `typedef` missing from the
> testcase, perhaps?
You mean modifying it like this:
typedef struct {
int f;
} statvfs64;
?
Then compiler issue an error: "redefine_extname.c:10:5: error: redefinition of
'statvfs64' as different kind of symbol". No errors are issued in the original
test.
http://reviews.llvm.org/D10187
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits