From: Louis Dionne Date: Fri, 22 Feb 2019 20:48:54 +0000 (+0000) Subject: [clang] Only provide C11 features in starting with C++17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bd1142fd002ee84a142e7cea3a02452487ef9bf;p=clang [clang] Only provide C11 features in starting with C++17 Summary: In r353970, I enabled those features in C++11 and above. To be strictly conforming, those features should only be enabled in C++17 and above. Reviewers: jfb, eli.friedman Subscribers: jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D58289 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354691 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/float.h b/lib/Headers/float.h index 92bddee2f6..46a8dae06a 100644 --- a/lib/Headers/float.h +++ b/lib/Headers/float.h @@ -78,7 +78,7 @@ # undef FLT_MIN # undef DBL_MIN # undef LDBL_MIN -# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L +# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L # undef FLT_TRUE_MIN # undef DBL_TRUE_MIN # undef LDBL_TRUE_MIN @@ -137,7 +137,7 @@ #define DBL_MIN __DBL_MIN__ #define LDBL_MIN __LDBL_MIN__ -#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L +#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L # define FLT_TRUE_MIN __FLT_DENORM_MIN__ # define DBL_TRUE_MIN __DBL_DENORM_MIN__ # define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ diff --git a/test/Headers/float.c b/test/Headers/float.c index 4f38725e27..70c11b0537 100644 --- a/test/Headers/float.c +++ b/test/Headers/float.c @@ -45,7 +45,7 @@ #endif -#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L +#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L #ifndef FLT_DECIMAL_DIG #error "Mandatory macro FLT_DECIMAL_DIG is missing." #elif FLT_DECIMAL_DIG < 6 @@ -215,7 +215,7 @@ _Static_assert(FLT_MANT_DIG == __FLT_MANT_DIG__, ""); _Static_assert(DBL_MANT_DIG == __DBL_MANT_DIG__, ""); _Static_assert(LDBL_MANT_DIG == __LDBL_MANT_DIG__, ""); -#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L +#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L _Static_assert(FLT_DECIMAL_DIG == __FLT_DECIMAL_DIG__, ""); _Static_assert(DBL_DECIMAL_DIG == __DBL_DECIMAL_DIG__, ""); _Static_assert(LDBL_DECIMAL_DIG == __LDBL_DECIMAL_DIG__, "");