Commit 207d694a authored by Stefan Behnel's avatar Stefan Behnel

Fix compiler warnings in clang and C++ about unknown "fallthrough" attribute.

Closes #1930.
parent b0e0e184
......@@ -26,6 +26,9 @@ Bugs fixed
* ``std::unordered_map.erase()`` was declared with an incorrect ``void`` return
type in ``libcpp.unordered_map``. (Github issue #1484)
* Invalid use of C++ ``fallthrough`` attribute before C++11 and similar issue in clang.
(Github issue #1930)
* Compiler crash on misnamed properties. (Github issue #1905)
......
......@@ -507,7 +507,7 @@
#ifndef CYTHON_FALLTHROUGH
#ifdef __cplusplus
#if defined(__cplusplus) && __cplusplus >= 201103L
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
......@@ -516,7 +516,9 @@
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__))
#if defined(__clang__) && __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#elif defined(__GNUC__) && defined(__attribute__)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment