From 069be61f3d62d32b38cf0a02fd276df367b10961 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sat, 13 Jul 2019 11:23:29 +0100 Subject: [PATCH] Fixed Clang warning -Wunreachable-code-return. --- src/parse/input.cc | 1 - src/regexp/ast_to_re.cc | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/parse/input.cc b/src/parse/input.cc index 2b5a3f55..9a3ca29e 100644 --- a/src/parse/input.cc +++ b/src/parse/input.cc @@ -43,7 +43,6 @@ bool Input::open(const std::string &filename, const std::string *parent if (!file) { fatal("cannot open file: %s", name.c_str()); - return false; } // name displayed in #line directives is the resolved name diff --git a/src/regexp/ast_to_re.cc b/src/regexp/ast_to_re.cc index ac94630e..4093e996 100644 --- a/src/regexp/ast_to_re.cc +++ b/src/regexp/ast_to_re.cc @@ -408,13 +408,13 @@ bool misuse_of_named_def(RESpec &spec, const AST *ast) { DASSERT(ast->type == AST::REF); - if (!spec.opts->posix_syntax) return false; - - spec.msg.fatal(ast->loc - , "implicit grouping is forbidden with '--posix-captures'" - " option, please wrap '%s' in capturing parenthesis" - , ast->ref.name->c_str()); - return true; + if (spec.opts->posix_syntax) { + spec.msg.fatal(ast->loc + , "implicit grouping is forbidden with '--posix-captures'" + " option, please wrap '%s' in capturing parenthesis" + , ast->ref.name->c_str()); + } + return false; } void assert_tags_used_once(RESpec &spec, const Rule &rule -- 2.50.1