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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index f310e989b5..c802966686 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -70,7 +70,7 @@ bool CXXNameMangler::mangle(const NamedDecl *D) {
else if (Context.getSourceManager().getFileCharacteristic(FD->getLocation())
== SrcMgr::C_ExternCSystem)
RequiresMangling = false;
- else if (Context.getLangOptions().CPlusPlus) {
+ else if (Context.getLangOptions().CPlusPlus && !FD->isMain()) {
// C++ requires name mangling, unless we're in a C linkage
// specification.
RequiresMangling = true;