From: Ulya Trofimovich Date: Sat, 13 Jul 2019 10:23:29 +0000 (+0100) Subject: Fixed Clang warning -Wunreachable-code-return. X-Git-Tag: 1.2~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=069be61f3d62d32b38cf0a02fd276df367b10961;p=re2c Fixed Clang warning -Wunreachable-code-return. --- 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