Fix a regression from 171193: main cannot be overloaded.

Thanks Eli Friedman for noticing it.

llvm-svn: 172292
This commit is contained in:
Rafael Espindola 2013-01-12 01:47:40 +00:00
parent 399bf618de
commit 7cf35ef8f6
2 changed files with 8 additions and 0 deletions

View File

@ -935,6 +935,11 @@ static bool canBeOverloaded(const FunctionDecl &D) {
return true;
if (D.hasCLanguageLinkage())
return false;
// Main cannot be overloaded (basic.start.main).
if (D.isMain())
return false;
return true;
}

View File

@ -29,3 +29,6 @@ class X {
static void g(float);
static void g(int); // expected-error {{static and non-static member functions with the same parameter types cannot be overloaded}}
};
int main() {} // expected-note {{previous definition is here}}
int main(int,char**) {} // expected-error {{conflicting types for 'main'}}