[PATCH] D21834: Implementing 'If statement with Initializer'

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 12:08:03 PDT 2016


rsmith added a comment.

There are a few missing pieces here:

1. Analysis/CFG.cpp needs to be taught to build a correct CFG for these. You can test this with an example like 'if (bool b; b)' which should give a -Wuninitialized warning.
2. AST/ExprConstant.cpp needs to be taught to perform constant evaluation for these properly.
3. More test coverage. In addition for test cases for the above two cases, please also add some tests to test/CodeGenCXX to test that we emit correct code for the expression and declaration form of these constructs, for both `if` and `switch`, and add a test that checks that the extra statement round-trips through an AST file properly (see test/PCH for some examples).


http://reviews.llvm.org/D21834





More information about the cfe-commits mailing list