aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dan@danw.org>2018-10-09 18:53:54 -0700
committerGitHub <noreply@github.com>2018-10-09 18:53:54 -0700
commit5b4c39fdfe2fc2e457e92ab997520c2d3836ff99 (patch)
tree886ad280ba97bd58fa4387a683f44f1d13974484
parent7d2255db4ec4ecca7ec73b02aaa7a7aa7b16d537 (diff)
parent72887f2f9a2f1c4fc50ac6f32572322764dfdd72 (diff)
downloadkati-5b4c39fdfe2fc2e457e92ab997520c2d3836ff99.tar.gz
Merge pull request #149 from danw/fallthrough
Mark fallthrough cases with [[clang::fallthrough]]
-rw-r--r--func.cc4
-rw-r--r--ninja.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/func.cc b/func.cc
index bc3e57f..8131e4b 100644
--- a/func.cc
+++ b/func.cc
@@ -64,7 +64,9 @@ void StripShellComment(string* cmd) {
in++;
break;
}
- /* FALLTHRU */
+#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+ [[clang::fallthrough]];
+#endif
case '\'':
case '"':
diff --git a/ninja.cc b/ninja.cc
index fb42444..0b87d5c 100644
--- a/ninja.cc
+++ b/ninja.cc
@@ -530,7 +530,9 @@ class NinjaGenerator {
case ':':
case ' ':
r += '$';
- // fall through.
+#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+ [[clang::fallthrough]];
+#endif
default:
r += c;
}