This revision was automatically updated to reflect the committed changes.
Closed by commit rG461f91b1e4ef: [clang][Interp] Handle LambdaExprs (authored
by tbaeder).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:954
+bool ByteCodeExprGen::VisitLambdaExpr(const LambdaExpr *E) {
+ // XXX We assume here that a poin
tbaeder updated this revision to Diff 522204.
tbaeder marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
Files:
clang/lib/AST/Interp/ByteCodeEmitter.cpp
clang/lib/AST/Interp/ByteCodeEmitter.h
clang/lib/AST/In
shafik added inline comments.
Comment at: clang/test/AST/Interp/lambda.cpp:5
+constexpr int a = 12;
+constexpr int f = [c = a]() { return c; }();
+static_assert(f == a);
Fun case
```
int constexpr f() {
return [x = 10] {
decltype(x) y; // type int b/c
aaron.ballman added inline comments.
Comment at: clang/test/AST/Interp/lambda.cpp:92
+ static_assert(foo() == 1); // expected-error {{not an integral constant
expression}}
+}
+
tbaeder wrote:
> tbaeder wrote:
> > tbaeder wrote:
> > > aaron.ballman wrote:
> > >
tbaeder added inline comments.
Comment at: clang/test/AST/Interp/lambda.cpp:92
+ static_assert(foo() == 1); // expected-error {{not an integral constant
expression}}
+}
+
tbaeder wrote:
> tbaeder wrote:
> > aaron.ballman wrote:
> > > How about some tests like:
tbaeder added inline comments.
Comment at: clang/test/AST/Interp/lambda.cpp:92
+ static_assert(foo() == 1); // expected-error {{not an integral constant
expression}}
+}
+
tbaeder wrote:
> aaron.ballman wrote:
> > How about some tests like:
> > ```
> > constexpr
tbaeder updated this revision to Diff 520155.
tbaeder marked 3 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
Files:
clang/lib/AST/Interp/ByteCodeEmitter.cpp
clang/lib/AST/Interp/ByteCodeEmitter.h
clang/lib/AST/In
tbaeder added inline comments.
Comment at: clang/test/AST/Interp/lambda.cpp:92
+ static_assert(foo() == 1); // expected-error {{not an integral constant
expression}}
+}
+
aaron.ballman wrote:
> How about some tests like:
> ```
> constexpr int call_thru_func_ptr
aaron.ballman added inline comments.
Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:56-57
+ const Record *R = P.getOrCreateRecord(MD->getParent());
+ llvm::DenseMap _LambdaCaptures;
+ FieldDecl *_LambdaThisCapture;
+
UB alert -- `_L` is reser
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder added a comment.
Ping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146030/new/
https://reviews.llvm.org/D146030
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Unfortunately I couldn't find an existing test file
17 matches
Mail list logo