[compiler-rt] 903b884 - sanitizer: Fix fallthrough detection.

Martin Liska via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 04:57:52 PDT 2022


Author: Martin Liska
Date: 2022-05-03T13:55:28+02:00
New Revision: 903b8845fb5a0a366266d6f28231f994a5721178

URL: https://github.com/llvm/llvm-project/commit/903b8845fb5a0a366266d6f28231f994a5721178
DIFF: https://github.com/llvm/llvm-project/commit/903b8845fb5a0a366266d6f28231f994a5721178.diff

LOG: sanitizer: Fix fallthrough detection.

First check for clang::fallthrough attribute that resolves:

sanitizer_stack_store.cpp:258:7: error: use of the 'fallthrough'
attribute is a C++17 extension [-Werror,-Wc++17-attribute-extensions]

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index 95a80b4629c77..ff65069de8db5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -259,10 +259,10 @@ typedef u64 tid_t;
 # define NOEXCEPT throw()
 #endif
 
-#if __has_cpp_attribute(fallthrough)
-#  define FALLTHROUGH [[fallthrough]]
-#elif __has_cpp_attribute(clang::fallthrough)
+#if __has_cpp_attribute(clang::fallthrough)
 #  define FALLTHROUGH [[clang::fallthrough]]
+#elif __has_cpp_attribute(fallthrough)
+#  define FALLTHROUGH [[fallthrough]]
 #else
 #  define FALLTHROUGH
 #endif


        


More information about the llvm-commits mailing list