[PATCH] D132727: [clang][Interp] Implement array initializers and subscript expressions
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 26 03:00:02 PDT 2022
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:553
+ if (!visitArrayInitializer(Init))
+ return false;
+ if (!this->emitPopPtr(Init))
----------------
I've been wondering about a macro to simplify code like this, e.g. `define DOIT(x) if(!x) return false;` that I could instead define to `assert(x)` during development.
================
Comment at: clang/test/AST/Interp/arrays.cpp:56
+// LValuePath correctly.
+//static_assert(data[0] == 4);
+
----------------
This is quite unfortunate, but it only fails when evaluating `data[0]` by itself, when printing the extra info for the failed `static_assert`. I roughly know what the problem is though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132727/new/
https://reviews.llvm.org/D132727
More information about the cfe-commits
mailing list