aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-10-10 02:01:17 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-10-10 02:01:17 +0000
commitdc1ffa73d10cef88afdbee90a6bd84f28ab69b82 (patch)
tree58437f02f99d1155972deca469f5da3198ddc413
parente16291bf844ee1ba60abd7ed28a386a1eff425d5 (diff)
parent0bff6a2c6f33b8a7b7abb3018f116f1d2088ac92 (diff)
downloadbison-dc1ffa73d10cef88afdbee90a6bd84f28ab69b82.tar.gz
Merge "Add clang::fallthrough annotations to bison templates"
-rw-r--r--data/glr.c3
-rw-r--r--data/lalr1.cc3
-rw-r--r--data/yacc.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/data/glr.c b/data/glr.c
index 02a76c21..08d4a3e6 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -635,6 +635,9 @@ yytnamerr (char *yyres, const char *yystr)
if (*++yyp != '\\')
goto do_not_strip_quotes;
/* Fall through. */
+#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+ [[clang::fallthrough]];
+#endif
default:
if (yyres)
yyres[yyn] = *yyp;
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 237b246f..c6e19777 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -376,6 +376,9 @@ do { \
if (*++yyp != '\\')
goto do_not_strip_quotes;
/* Fall through. */
+#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+ [[clang::fallthrough]];
+#endif
default:
yyr += *yyp;
break;
diff --git a/data/yacc.c b/data/yacc.c
index b34549f1..17ad67c0 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -1209,6 +1209,9 @@ yytnamerr (char *yyres, const char *yystr)
if (*++yyp != '\\')
goto do_not_strip_quotes;
/* Fall through. */
+#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+ [[clang::fallthrough]];
+#endif
default:
if (yyres)
yyres[yyn] = *yyp;