forked from OSchip/llvm-project
Fix a regression from 171193: main cannot be overloaded.
Thanks Eli Friedman for noticing it. llvm-svn: 172292
This commit is contained in:
parent
399bf618de
commit
7cf35ef8f6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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'}}
|
||||
|
|
Loading…
Reference in New Issue