Skip to content

Commit c2d9579

Browse files
committedFeb 22, 2019
[clang] Only provide C11 features in <float.h> 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 llvm-svn: 354691
1 parent e69f94e commit c2d9579

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

Diff for: ‎clang/lib/Headers/float.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
# undef FLT_MIN
7979
# undef DBL_MIN
8080
# undef LDBL_MIN
81-
# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
81+
# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
8282
# undef FLT_TRUE_MIN
8383
# undef DBL_TRUE_MIN
8484
# undef LDBL_TRUE_MIN
@@ -137,7 +137,7 @@
137137
#define DBL_MIN __DBL_MIN__
138138
#define LDBL_MIN __LDBL_MIN__
139139

140-
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
140+
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
141141
# define FLT_TRUE_MIN __FLT_DENORM_MIN__
142142
# define DBL_TRUE_MIN __DBL_DENORM_MIN__
143143
# define LDBL_TRUE_MIN __LDBL_DENORM_MIN__

Diff for: ‎clang/test/Headers/float.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#endif
4646

4747

48-
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
48+
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
4949
#ifndef FLT_DECIMAL_DIG
5050
#error "Mandatory macro FLT_DECIMAL_DIG is missing."
5151
#elif FLT_DECIMAL_DIG < 6
@@ -215,7 +215,7 @@ _Static_assert(FLT_MANT_DIG == __FLT_MANT_DIG__, "");
215215
_Static_assert(DBL_MANT_DIG == __DBL_MANT_DIG__, "");
216216
_Static_assert(LDBL_MANT_DIG == __LDBL_MANT_DIG__, "");
217217

218-
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
218+
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
219219
_Static_assert(FLT_DECIMAL_DIG == __FLT_DECIMAL_DIG__, "");
220220
_Static_assert(DBL_DECIMAL_DIG == __DBL_DECIMAL_DIG__, "");
221221
_Static_assert(LDBL_DECIMAL_DIG == __LDBL_DECIMAL_DIG__, "");

0 commit comments

Comments
 (0)
Please sign in to comment.