[PATCH] D33036: [Support/Compiler.h] - Use gnu::fallthrough for LLVM_FALLTHROUGH when available.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 02:28:22 PDT 2017


grimar updated this revision to Diff 98600.
grimar added a comment.

- Addressed review comments.


https://reviews.llvm.org/D33036

Files:
  Compiler.h


Index: Compiler.h
===================================================================
--- Compiler.h
+++ Compiler.h
@@ -227,6 +227,8 @@
 /// LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
 #define LLVM_FALLTHROUGH [[fallthrough]]
+#elif __has_cpp_attribute(gnu::fallthrough)
+#define LLVM_FALLTHROUGH [[gnu::fallthrough]]
 #elif !__cplusplus
 // Workaround for llvm.org/PR23435, since clang 3.6 and below emit a spurious
 // error when __has_cpp_attribute is given a scoped attribute in C mode.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33036.98600.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170511/1150128f/attachment.bin>


More information about the llvm-commits mailing list