aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-12 07:09:11 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-12 07:09:11 +0000
commit7b49202090678f45fa0c0bb5fa560d8a27b0c604 (patch)
treed6ec318c14bd0d7a33b3be7be081d3aca04b47af /lib/Sema/SemaOverload.cpp
parenta205061727b430556e06c7046b8533098df1ed6e (diff)
Handle the obvious case for diagnosing redeclarations of extern "C" functions.
Fixes PR7859. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 339a79384c..047a5d9ba5 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -573,6 +573,11 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool UseUsingDeclRules) {
+ // If both of the functions are extern "C", then they are not
+ // overloads.
+ if (Old->isExternC() && New->isExternC())
+ return false;
+
FunctionTemplateDecl *OldTemplate = Old->getDescribedFunctionTemplate();
FunctionTemplateDecl *NewTemplate = New->getDescribedFunctionTemplate();