aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 5a994d2234..878f13d516 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -131,7 +131,7 @@ bool CXXNameMangler::mangleFunctionDecl(const FunctionDecl *FD) {
return false;
// No name mangling in a C linkage specification.
- if (isInCLinkageSpecification(FD))
+ if (!isa<CXXMethodDecl>(FD) && isInCLinkageSpecification(FD))
return false;
}
@@ -502,6 +502,9 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) {
// ::= <substitution>
// FIXME: We only handle mangling of namespaces and classes at the moment.
+ while (isa<LinkageSpecDecl>(DC))
+ DC = DC->getParent();
+
if (DC->isTranslationUnit())
return;