Skip to content

Commit

Permalink
Comma expresion for MSVC fold expression bug
Browse files Browse the repository at this point in the history
Boolean fold expression seems like some bugs in MSVC, it's incorrectly
removed. In other projects, we found similar problems. But gcc or clang
not.

On the other hand, fold expression with comma seems cleaner than lambda.

Referenced-by: ZigRazor/CXXGraph#415
  • Loading branch information
GinShio authored and nhaehnle committed Oct 22, 2024
1 parent a3f36a8 commit 052d8b8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/llvm-dialects/Dialect/OpSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ class OpSet final {
template <typename... OpTs> static const OpSet &get() {
static const auto set = ([]() {
OpSet set;
(void)(... && ([&set]() {
set.tryInsertOp(OpDescription::get<OpTs>());
return true;
})());
(..., set.tryInsertOp(OpDescription::get<OpTs>()));
return set;
})();
return set;
Expand Down

0 comments on commit 052d8b8

Please sign in to comment.