aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-02-14 03:31:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-02-14 03:31:26 +0000
commit747836e5c79b5e12fe9cfb9b724dc4edeb115419 (patch)
tree83acac8e7d9a9b612d7ae76703e75228e0d8ae48 /lib/Sema/SemaOverload.cpp
parentd2fdd4256a2efc41365ccdd27a210d1d99a1fe3a (diff)
Partially revert r175117 so that we don't break assumptions about how
static functions in extern "C" contexts are mangled. Should fix the bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 9bba5f6c78..20fb7a768b 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/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;
}