[Openmp-commits] [PATCH] D57851: Guard a feature that unsupported by old GCC

Taewook Oh via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 6 14:47:14 PST 2019

twoh created this revision.
twoh added reviewers: protze.joachim, jlpeyton, AndreyChurbanov, Hahnfeld, david2050.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

As @david2050 commented, changes introduced by https://reviews.llvm.org/D56397 break builds for older compilers
which don't support `__has(_cpp)_attribute`. This is a fix for the break.

  rG LLVM Github Monorepo



Index: openmp/runtime/src/kmp_os.h
--- openmp/runtime/src/kmp_os.h
+++ openmp/runtime/src/kmp_os.h
@@ -300,6 +300,7 @@
 // case label is intentional and should not be diagnosed by a compiler
 //   Code from libcxx/include/__config
 // Use a function like macro to imply that it must be followed by a semicolon
+#if !KMP_COMPILER_GCC || __GNUC__ >= 5
 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
 #  define KMP_FALLTHROUGH() [[fallthrough]]
 #elif __has_cpp_attribute(clang::fallthrough)
@@ -309,6 +310,9 @@
 #  define KMP_FALLTHROUGH() ((void)0)
+#else // !KMP_COMPILER_GCC || __GNUC__ >= 5
+#define KMP_FALLTHROUGH() ((void)0)
+#endif // !KMP_COMPILER_GCC || __GNUC__ >= 5
 // Define attribute that indicates a function does not return
 #if __cplusplus >= 201103L

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57851.185647.patch
Type: text/x-patch
Size: 868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190206/2894c8ee/attachment.bin>

More information about the Openmp-commits mailing list