[libunwind] 9e32d7b - [libunwind] Remove static_assert / __has_feature macros
Ryan Prichard via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 24 14:08:07 PDT 2020
Author: Ryan Prichard
Date: 2020-08-24T14:07:20-07:00
New Revision: 9e32d7b6e7e6615dbc5049a53f8e2ba03ae0292f
URL: https://github.com/llvm/llvm-project/commit/9e32d7b6e7e6615dbc5049a53f8e2ba03ae0292f
DIFF: https://github.com/llvm/llvm-project/commit/9e32d7b6e7e6615dbc5049a53f8e2ba03ae0292f.diff
LOG: [libunwind] Remove static_assert / __has_feature macros
The static_assert macro broke on GCC when a scope had two asserts and a
condition that depended on a template parameter. Remove the macro and
rely on the compiler's C++11 static_assert feature.
The __has_feature macro was only used here to determine whether to
define the static_assert macro.
Reviewed By: mstorsjo, #libunwind
Differential Revision: https://reviews.llvm.org/D86411
Added:
Modified:
libunwind/src/config.h
Removed:
################################################################################
diff --git a/libunwind/src/config.h b/libunwind/src/config.h
index 842fd829af19..c6f71c1b93d3 100644
--- a/libunwind/src/config.h
+++ b/libunwind/src/config.h
@@ -18,16 +18,6 @@
#include <stdint.h>
#include <stdlib.h>
-// Define static_assert() unless already defined by compiler.
-#ifndef __has_feature
- #define __has_feature(__x) 0
-#endif
-#if !(__has_feature(cxx_static_assert)) && !defined(static_assert)
- #define static_assert(__b, __m) \
- extern int compile_time_assert_failed[ ( __b ) ? 1 : -1 ] \
- __attribute__( ( unused ) );
-#endif
-
// Platform specific configuration defines.
#ifdef __APPLE__
#if defined(FOR_DYLD)
More information about the cfe-commits
mailing list