Handle static functions being redeclared in function scope.
Fixes pr14861. llvm-svn: 171978
This commit is contained in:
parent
9f64604e74
commit
3bd836a58e
|
@ -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())
|
||||
|
|
|
@ -40,3 +40,11 @@ namespace test4 {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace test5 {
|
||||
static void g();
|
||||
void f()
|
||||
{
|
||||
void g();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue