summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 9bba5f6c78d..20fb7a768be 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -974,6 +974,14 @@ static bool canBeOverloaded(const FunctionDecl &D) {
if (D.isMain())
return false;
+ // FIXME: Users assume they know the mangling of static functions
+ // declared in extern "C" contexts. For now just disallow overloading these
+ // functions so that we can avoid mangling them.
+ const DeclContext *DC = D.getDeclContext();
+ if (!DC->isRecord() &&
+ D.getFirstDeclaration()->getDeclContext()->isExternCContext())
+ return false;
+
return true;
}
OpenPOWER on IntegriCloud