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

2018-12-10 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL348789: [constexpr][c++2a] Try-catch blocks in constexpr functions (authored by bruno, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D55097?v

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

2018-12-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from a few other small nits. Comment at: lib/Sema/SemaDeclCXX.cpp:1904 + case Stmt::CXXTryStmtClass: +if (!Cxx2aLoc.isValid()) + Cxx2aLoc =

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

2018-12-07 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno updated this revision to Diff 177367. bruno marked an inline comment as done. bruno added a comment. Address @aaron.ballman and @erik.pilkington reviews. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55097/new/ https://reviews.llvm.org/D55097 Files: include/clang/Basic/Diagnost

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

2018-12-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Some minor nits from the peanut gallery. Comment at: lib/AST/ExprConstant.cpp:4278 + case Stmt::CXXTryStmtClass: +// Evaluate try blocks by evaluating all sub statements +return EvaluateStmt(Result, Info, cast(S)->getTryBlock(), Case); -

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

2018-12-07 Thread Erik Pilkington via Phabricator via cfe-commits
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, ReturnStmt

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

2018-12-04 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno updated this revision to Diff 176733. bruno added a comment. Update patch after @erik.pilkington review! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55097/new/ https://reviews.llvm.org/D55097 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/AST/ExprConstant.cpp lib/S

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

2018-12-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Bruno, thanks for working on this! Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2370 + "use of this statement in a constexpr %select{function|constructor}0 " + "is incompatible with C++ standards before C++20">, + InGroup, Defaul

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

2018-12-04 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno updated this revision to Diff 176559. bruno added a comment. Address @rsmith comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55097/new/ https://reviews.llvm.org/D55097 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/AST/ExprConstant.cpp lib/Sema/SemaDeclCXX.cpp

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

2018-11-29 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/AST/ExprConstant.cpp:4278-4287 +// Evaluate try blocks by evaluating all sub statements and keep track +// whether there's a return. +EvalStmtResult ESR = ESR_Succeeded; +for (const Stmt *SubStmt : S->children()) { +

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

2018-11-29 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno created this revision. bruno added reviewers: rsmith, ahatanak, erik.pilkington. Herald added subscribers: dexonsmith, jkorous. Implement support for try-catch blocks in constexpr functions, as proposed in http://wg21.link/P1002 and voted in San Diego for c++20. The idea is that we can stil