From e447e32aa105dac13375818c245404120d5f28af Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Wed, 14 Jul 2021 11:04:01 +0430 Subject: fix for llvm 13 --- cgrep.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cgrep.cpp') diff --git a/cgrep.cpp b/cgrep.cpp index 41ef737..3cdff06 100644 --- a/cgrep.cpp +++ b/cgrep.cpp @@ -1106,11 +1106,16 @@ private: /*Main*/ int main(int argc, const char **argv) { #if __clang_major__ >= 13 - auto op = CommonOptionsParser::create(argc, argv, CGrepCat); + auto op = + CommonOptionsParser::create(argc, argv, CGrepCat); + if (auto error = op.takeError()) { + errs() << toString(std::move(error)) << "\n"; + return 1; + } + ClangTool Tool(op->getCompilations(), op->getSourcePathList()); #else CommonOptionsParser op(argc, argv, CGrepCat); #endif - ClangTool Tool(op.getCompilations(), op.getSourcePathList()); int ret = 0; if ("" != CO_TRACE) { -- cgit v1.2.3