We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5352b4c commit e447e32Copy full SHA for e447e32
cgrep.cpp
@@ -1106,11 +1106,16 @@ class CgrepFrontendAction : public ASTFrontendAction {
1106
/*Main*/
1107
int main(int argc, const char **argv) {
1108
#if __clang_major__ >= 13
1109
- auto op = CommonOptionsParser::create(argc, argv, CGrepCat);
+ auto op =
1110
+ CommonOptionsParser::create(argc, argv, CGrepCat);
1111
+ if (auto error = op.takeError()) {
1112
+ errs() << toString(std::move(error)) << "\n";
1113
+ return 1;
1114
+ }
1115
+ ClangTool Tool(op->getCompilations(), op->getSourcePathList());
1116
#else
1117
CommonOptionsParser op(argc, argv, CGrepCat);
1118
#endif
- ClangTool Tool(op.getCompilations(), op.getSourcePathList());
1119
int ret = 0;
1120
1121
if ("" != CO_TRACE) {
0 commit comments