[PATCH] PR5172: Fix for a bug in pragma redefine_extname implementation.

Richard Smith richard at metafoo.co.uk
Fri Jun 5 12:22:10 PDT 2015


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.) 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`.

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?


http://reviews.llvm.org/D10187

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list