[PATCH] D43980: Push a function scope when parsing function bodies without a declaration

2018-03-07 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. Thanks! John touched this code last in https://reviews.llvm.org/rL112038 in 2010, so maybe he has some thoughts on how to clean this and the follow-up. I think I'll land this as is since it fixes the crash and we can discuss more improvements in

[PATCH] D43980: Push a function scope when parsing function bodies without a declaration

2018-03-07 Thread Reid Kleckner via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC326926: Push a function scope when parsing function bodies without a declaration (authored by rnk, committed by ). Changed prior to commit: https://reviews.llvm.org/D43980?vs=136635=137437#toc

[PATCH] D43980: Push a function scope when parsing function bodies without a declaration

2018-03-07 Thread Reid Kleckner via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326926: Push a function scope when parsing function bodies without a declaration (authored by rnk, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D43980: Push a function scope when parsing function bodies without a declaration

2018-03-07 Thread Nico Weber via Phabricator via cfe-commits
thakis accepted this revision. thakis added a comment. This revision is now accepted and ready to land. Fix LGTM, one optional comment below. Comment at: clang/lib/Sema/SemaDecl.cpp:12412 +// anyway so we can try to parse the function body. +PushFunctionScope();

[PATCH] D43980: Push a function scope when parsing function bodies without a declaration

2018-03-01 Thread Reid Kleckner via Phabricator via cfe-commits
rnk created this revision. rnk added a reviewer: rsmith. This is PR36536. There are a few ways to reach Sema::ActOnStartOfFunctionDef with a null Decl. Currently, the parser continues on to attempt to parse the statements in the function body without pushing a function scope or declaration