diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-10-10 02:01:17 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-10-10 02:01:17 +0000 |
commit | dc1ffa73d10cef88afdbee90a6bd84f28ab69b82 (patch) | |
tree | 58437f02f99d1155972deca469f5da3198ddc413 | |
parent | e16291bf844ee1ba60abd7ed28a386a1eff425d5 (diff) | |
parent | 0bff6a2c6f33b8a7b7abb3018f116f1d2088ac92 (diff) | |
download | bison-dc1ffa73d10cef88afdbee90a6bd84f28ab69b82.tar.gz |
Merge "Add clang::fallthrough annotations to bison templates"
-rw-r--r-- | data/glr.c | 3 | ||||
-rw-r--r-- | data/lalr1.cc | 3 | ||||
-rw-r--r-- | data/yacc.c | 3 |
3 files changed, 9 insertions, 0 deletions
@@ -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; |