diff options
-rw-r--r-- | lib/AST/Decl.cpp | 4 | ||||
-rw-r--r-- | test/SemaCXX/linkage2.cpp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 35e61b5775..bf5bfaaef1 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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()) diff --git a/test/SemaCXX/linkage2.cpp b/test/SemaCXX/linkage2.cpp index bab163db2a..072dcd2413 100644 --- a/test/SemaCXX/linkage2.cpp +++ b/test/SemaCXX/linkage2.cpp @@ -40,3 +40,11 @@ namespace test4 { }; } } + +namespace test5 { + static void g(); + void f() + { + void g(); + } +} |