[libcxx-commits] [PATCH] D86411: [libunwind] Remove static_assert / __has_feature macros

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 22 17:24:44 PDT 2020


rprichard created this revision.
rprichard added reviewers: compnerd, mstorsjo.
Herald added projects: LLVM, libunwind.
Herald added subscribers: libcxx-commits, llvm-commits.
Herald added a reviewer: libunwind.
rprichard requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86411

Files:
  libunwind/src/config.h


Index: libunwind/src/config.h
===================================================================
--- libunwind/src/config.h
+++ 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86411.287229.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200823/ba3ba34e/attachment.bin>


More information about the libcxx-commits mailing list