[PATCH] D33676: Place implictly declared functions at block scope

Momchil Velikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 09:44:08 PDT 2017


chill added inline comments.


================
Comment at: lib/Parse/ParseStmt.cpp:843-845
+  return ParseCompoundStatement(isStmtExpr,
+                                Scope::DeclScope | Scope::CompoundStmtScope);
 }
----------------
rsmith wrote:
> This seems to miss quite a lot of places that introduce compound statement scopes. (Search for callers of `ParseCompundStatementBody` and callers of the 2-argument form of `ParseCompoundStatement` for those.)
Yes, all the other cases are not applicable to C90, they are C++, ObjC, etc and the new flag is tested only in one place and only for C90.
However, for the sake of consistency, I've updated the patch to set the compound statement flag on all compound statements, including function bodies, try/catch/finally/blocks and whatnot.



https://reviews.llvm.org/D33676





More information about the cfe-commits mailing list