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
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 =
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
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);
-
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
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
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
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
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()) {
+
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
10 matches
Mail list logo