]> granicus.if.org Git - re2c/commitdiff
Fixed Clang warning -Wunreachable-code-return.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 10:23:29 +0000 (11:23 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 10:23:29 +0000 (11:23 +0100)
src/parse/input.cc
src/regexp/ast_to_re.cc

index 2b5a3f5534cc4553afc6a2c68ef6ea9081c3fe92..9a3ca29e6b47c2ae5e73150dcabbc11f8acdc757 100644 (file)
@@ -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
index ac94630ef872950083d2285756e6d0bd8adcfdb7..4093e996717399fc71e7f3351319a76863b9d4cc 100644 (file)
@@ -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