[PATCH] D57086: Ignore trailing NullStmts in StmtExprs for GCC compatibility

Dominic Ferreira via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 9 23:11:07 PDT 2019


domdom updated this revision to Diff 203775.
domdom added a comment.

Sorry I it's taken me a while to get back to this work. I've rebased the changes and taken advantage of the refactoring to stop modifying the CompoundStmt after creating it. This definitely simplified the changes required in Stmt.h, which is nice.

I've addressed the the need to update the TreeTransformer for the template case, and added a test case for that.

Something I should ask, it seems like GCC only ignores the NullStmts at the end if it's in C mode. Should clang match this behaviour exactly?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57086/new/

https://reviews.llvm.org/D57086

Files:
  clang/include/clang/AST/Stmt.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/Parse/ParseStmt.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/TreeTransform.h
  clang/test/AST/ast-dump-stmt.c
  clang/test/CodeGen/exprs.c
  clang/test/Sema/statements.c
  clang/test/SemaCXX/statements.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57086.203775.patch
Type: text/x-patch
Size: 10356 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190610/236a9209/attachment.bin>


More information about the cfe-commits mailing list