summaryrefslogtreecommitdiffstats
path: root/clang/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
commit46d2b6bacfc3208376668c41b7907468bf7df0ff (patch)
tree1378eea8956dd3b06a44e6430a3028f18fb921ca /clang/lib/Sema/SemaOverload.cpp
parentc5d33d83597329bd3fba2f274723ae2dbd9e20a7 (diff)
downloadbcm5719-llvm-46d2b6bacfc3208376668c41b7907468bf7df0ff.tar.gz
bcm5719-llvm-46d2b6bacfc3208376668c41b7907468bf7df0ff.zip
Partially revert r175117 so that we don't break assumptions about how
static functions in extern "C" contexts are mangled. Should fix the bootstrap. llvm-svn: 175132
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