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
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
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:
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();
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