]> granicus.if.org Git - clang/commit
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)
commitc371db6b1dac65d61c8952b6198cc970a9e25ee4
tree0a3d958bc96dd3405509a18e130f178838d0111b
parent6fa375376ba320544eb2f7064f7fa718e6086c44
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185745 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/CXX/basic/basic.start/basic.start.main/p2.cpp