Sema: Fix a crash when main is redeclared as a function-template.
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 6 Jul 2013 02:13:46 +0000 (02:13 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 6 Jul 2013 02:13:46 +0000 (02:13 +0000)
commit027f9c4026a8da9eb2714ae381f1966459dc9839
tree741d8b308c982d76f4c423b2b202636949a9aa0d
parent574d521c85ed1fd00f751bf45cf0648db25dc088
Sema: Fix a crash when main is redeclared as a function-template.

This boils down to us sending invalid function decls to
CheckFunctionDeclaration becauswe we did not consider that CheckMain
could cause the decl to be invalid.  Instead, interogate the new decl's
main-validity and *then* send it over to get CheckFunctionDeclaration'd
if it was still valid after calling CheckMain.

llvm-svn: 185745
clang/lib/Sema/SemaDecl.cpp
clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp