aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-10-09 18:51:13 -0700
committerDan Willemsen <dwillemsen@google.com>2018-10-09 18:51:13 -0700
commit0bff6a2c6f33b8a7b7abb3018f116f1d2088ac92 (patch)
tree58437f02f99d1155972deca469f5da3198ddc413
parente16291bf844ee1ba60abd7ed28a386a1eff425d5 (diff)
downloadbison-0bff6a2c6f33b8a7b7abb3018f116f1d2088ac92.tar.gz
Add clang::fallthrough annotations to bison templates
Test: build aidl with new templates, no more warning Change-Id: Id5bd595e3e11f0b414e4475a5ec55113350dbc5a
-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;