diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-24 01:23:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-24 01:23:02 +0000 |
commit | 04495c859f81e440748a9b86baa2913461652bb0 (patch) | |
tree | c13d0124fe2a867d14b29d08537baf7c01350424 /lib/CodeGen/Mangle.cpp | |
parent | 25cbd9ffd59ce575761295f094031daf1afda881 (diff) |
Improve merging of function declarations. Specifically:
- When we are declaring a function in local scope, we can merge with
a visible declaration from an outer scope if that declaration
refers to an entity with linkage. This behavior now works in C++
and properly ignores entities without linkage.
- Diagnose the use of "static" on a function declaration in local
scope.
- Diagnose the declaration of a static function after a non-static
declaration of the same function.
- Propagate the storage specifier to a function declaration from a
prior declaration (PR3425)
- Don't name-mangle "main"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 2 |
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; |