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

Momchil Velikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 01:34:03 PDT 2017


chill updated this revision to Diff 101522.
chill added a comment.

Update 1 notes.

The scopes for compound statements are explicitly marked as such, so then `Sema::ImplicitylDefineFunction` can ascend to the nearest enclosing scope. The function scopes (ones with `Scope:FnScope`) do not necessarily have the `Scope::CompoundStmtScope` flag set, that's why this flag is tested separately. I have considered, for consistency, setting the compound statement flag to all kinds of compound statement scopes, including function scopes, try/catch/SEH, block scopes, etc., but , given that this makes difference just for C90, I decided that such sweeping changes are unwarranted.


https://reviews.llvm.org/D33676

Files:
  include/clang/Sema/Scope.h
  lib/Parse/ParseStmt.cpp
  lib/Sema/SemaDecl.cpp
  test/Sema/implicit-decl-c90.c
  test/Sema/implicit-decl.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33676.101522.patch
Type: text/x-patch
Size: 4458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170606/a94bba70/attachment.bin>


More information about the cfe-commits mailing list