diff options
author | Alexander Richardson <arichardson.kde@gmail.com> | 2018-07-24 12:40:56 +0000 |
---|---|---|
committer | Alexander Richardson <arichardson.kde@gmail.com> | 2018-07-24 12:40:56 +0000 |
commit | 2a6a3fc4a39bf73c909f00a672ef300edffa18e2 (patch) | |
tree | d3cb783da0c17325f1ce04cf3fc09e01a6b30d7e /libcxx/test | |
parent | 63600c7487dcdd10f0e10a35ffe2f5f9f538ddda (diff) | |
download | bcm5719-llvm-2a6a3fc4a39bf73c909f00a672ef300edffa18e2.tar.gz bcm5719-llvm-2a6a3fc4a39bf73c909f00a672ef300edffa18e2.zip |
Stop wrapping __has_include in another macro
Summary:
This is not guaranteed to work since the characters after '__has_include('
have special lexing rules that can't possibly be applied when
__has_include is generated by a macro. It also breaks the crash reproducers
generated by -frewrite-includes (see https://llvm.org/pr37990).
Reviewers: EricWF, rsmith, mclow.lists
Reviewed By: mclow.lists
Differential Revision: https://reviews.llvm.org/D49067
llvm-svn: 337824
Diffstat (limited to 'libcxx/test')
-rw-r--r-- | libcxx/test/support/test_macros.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 5d38bcfc60a..dbbfd53094e 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -27,10 +27,8 @@ #define TEST_HAS_FEATURE(X) 0 #endif -#ifdef __has_include -#define TEST_HAS_INCLUDE(X) __has_include(X) -#else -#define TEST_HAS_INCLUDE(X) 0 +#ifndef __has_include +#define __has_include(...) 0 #endif #ifdef __has_extension @@ -90,7 +88,7 @@ #endif // Attempt to deduce GCC version -#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>) +#if defined(_LIBCPP_VERSION) && __has_include(<features.h>) #include <features.h> #define TEST_HAS_GLIBC #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) |