[PATCH] D34600: [Error] add expectSuccess()

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 17:05:20 PDT 2017


lhames added a comment.

cantFail always felt like a quirky name though - what about 'assertSuccess'?

> This seems like a textbook assert use case to me. No different than assert(foo != nullptr);

Yep. The only reason to use cantFail/expectSuccess is if you *know* the callee can't return an error via this callsite. If you're wrong about that it's a programmatic error like any other.


https://reviews.llvm.org/D34600





More information about the llvm-commits mailing list