[cfe-commits] r171978 - in /cfe/trunk: lib/AST/Decl.cpp test/SemaCXX/linkage2.cpp
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 9 08:34:58 PST 2013
Author: rafael
Date: Wed Jan 9 10:34:58 2013
New Revision: 171978
URL: http://llvm.org/viewvc/llvm-project?rev=171978&view=rev
Log:
Handle static functions being redeclared in function scope.
Fixes pr14861.
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/test/SemaCXX/linkage2.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=171978&r1=171977&r2=171978&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Wed Jan 9 10:34:58 2013
@@ -803,6 +803,10 @@
!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())
Modified: cfe/trunk/test/SemaCXX/linkage2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/linkage2.cpp?rev=171978&r1=171977&r2=171978&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/linkage2.cpp (original)
+++ cfe/trunk/test/SemaCXX/linkage2.cpp Wed Jan 9 10:34:58 2013
@@ -40,3 +40,11 @@
};
}
}
+
+namespace test5 {
+ static void g();
+ void f()
+ {
+ void g();
+ }
+}
More information about the cfe-commits
mailing list