Handle static functions being redeclared in function scope.

Fixes pr14861.

llvm-svn: 171978
This commit is contained in:
Rafael Espindola 2013-01-09 16:34:58 +00:00
parent 9f64604e74
commit 3bd836a58e
2 changed files with 12 additions and 0 deletions

View File

@ -803,6 +803,10 @@ static LinkageInfo computeLVForDecl(const NamedDecl *D, bool OnlyTemplate) {
!Function->getDeclContext()->isExternCContext())
return LinkageInfo::uniqueExternal();
// This is a "void f();" which got merged with a file static.
if (Function->getStorageClass() == SC_Static)
return LinkageInfo::internal();
LinkageInfo LV;
if (!OnlyTemplate) {
if (llvm::Optional<Visibility> Vis = Function->getExplicitVisibility())

View File

@ -40,3 +40,11 @@ namespace test4 {
};
}
}
namespace test5 {
static void g();
void f()
{
void g();
}
}