You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FWIW, it may be more tricky than it seems. The Error case is straightforward, the Expect<T> isn't. In the OutputSizeLimitTest.cpp example, the goal is to assign Var to *Expect, while in the ResourceScriptParser.cpp example, Var gets assigned Expect. Then, here it gets more interesting, with references and const references.
Maybe we end up with a few macros, but then again, maybe having these macros n-plicated isn't so bad afterall.
Also:
and there's also ErrorOr.
ASSIGN_OR_ERROR (and RETURN_IF_ERROR) is a very good name, it's also unfortunately taken by abseil. If these appear in a header, it will complicate codebases where llvm and abseil mix.
mtrofin
added a commit
to mtrofin/llvm-project
that referenced
this issue
May 14, 2024
Examples:
RETURN_IF_ERROR
andASSIGN_OR_RETURN
or these with a slightly different name.The idea is to place them in Error.h
The text was updated successfully, but these errors were encountered: