[PATCH] D66487: Fix -Wimplicit-fallthrough warnings in regcomp.c

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 12:49:49 PDT 2019


aaron.ballman added inline comments.


================
Comment at: llvm/trunk/include/llvm/Support/Compiler.h:255
 #define LLVM_FALLTHROUGH [[fallthrough]]
 #elif __has_cpp_attribute(gnu::fallthrough)
 #define LLVM_FALLTHROUGH [[gnu::fallthrough]]
----------------
nickdesaulniers wrote:
> then this should have a guard for `__cplusplus`, too then? (or an `#if` around the C++ parts).
Yes, I think this needs to become `#elif defined(__cplusplus) && __has_cpp_attribute(gnu::fallthrough)`.

There may be a better way we can use macros to abstract that away, but my quick attempt failed: https://godbolt.org/z/f7I68U


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66487/new/

https://reviews.llvm.org/D66487





More information about the llvm-commits mailing list