aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}