diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-21 16:57:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-21 16:57:46 +0000 |
commit | 0bab54cf82cd679152197c7a2eb938f8aa9f07dd (patch) | |
tree | 4e334ad9bd43920c29d7d58b7c1697d1ac412d89 /lib/AST/Decl.cpp | |
parent | 9ee5ee84f0ad8246bff105786a128c7a909fdf12 (diff) |
Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.
Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 4898d6f2fc..5a1edbd0e6 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1001,7 +1001,7 @@ bool FunctionDecl::isExternC() const { break; } - return false; + return isMain(); } bool FunctionDecl::isGlobal() const { |