[PATCH] D128467: [clang][dataflow] Allow MatchSwitch to return a value

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 23 16:29:30 PDT 2022


gribozavr2 accepted this revision.
gribozavr2 added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h:49
 /// appropriate handler.
-template <typename State>
-using MatchSwitch = std::function<void(const Stmt &, ASTContext &, State &)>;
+template <typename State, typename Output = void>
+using MatchSwitch = std::function<Output(const Stmt &, ASTContext &, State &)>;
----------------
WDYT? like a "function result"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128467/new/

https://reviews.llvm.org/D128467



More information about the cfe-commits mailing list