From 46d2b6bacfc3208376668c41b7907468bf7df0ff Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 14 Feb 2013 03:31:26 +0000 Subject: 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 --- clang/lib/Sema/SemaOverload.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Sema/SemaOverload.cpp') 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; } -- cgit v1.2.3