[PATCH] D55097: [constexpr][c++2a] Try-catch blocks in constexpr functions

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 7 16:45:56 PST 2018


erik.pilkington added a comment.

LGTM, but you should probably let @rsmith have the final word!



================
Comment at: lib/Sema/SemaDeclCXX.cpp:1916-1919
+    for (Stmt *SubStmt : S->children())
+      if (SubStmt &&
+          !CheckConstexprFunctionStmt(SemaRef, Dcl, SubStmt, ReturnStmts,
+                                      Cxx1yLoc, Cxx2aLoc))
----------------
Might be clearer to just write `if (!CheckConstexprFunctionStmt(SemaRef, Dcl, cast<CXXCatchStmt>(SubStmt)->getHandlerBlock()))`, rather than looping over 1 statement. Could you also add that example I posted as a testcase for this?


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

https://reviews.llvm.org/D55097





More information about the cfe-commits mailing list