Skip to content

Commit 3555af7

Browse files
committed
[libc++] Do not define _LIBCPP_CLANG_VER for non-LLVM Clang
In r292833, we started defining _LIBCPP_CLANG_VER to 0 for Apple Clang. The result is that AppleClang is detected as being a very old version of LLVM Clang (version 0), which is obviously incorrect. I believe this was added so that we don't have to check whether _LIBCPP_CLANG_VER is defined prior to comparing it with a number (which can trigger a warning). This commit also fixes the two places that use the macro correspondingly. llvm-svn: 368880
1 parent c0a9b1e commit 3555af7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

libcxx/include/__config

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,6 @@
183183
# define _LIBCPP_COMPILER_IBM
184184
#endif
185185

186-
#ifndef _LIBCPP_CLANG_VER
187-
#define _LIBCPP_CLANG_VER 0
188-
#endif
189-
190186
#if defined(_LIBCPP_COMPILER_GCC) && __cplusplus < 201103L
191187
#error "libc++ does not support using GCC with C++03. Please enable C++11"
192188
#endif
@@ -484,7 +480,7 @@ typedef __char32_t char32_t;
484480
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
485481

486482
// No apple compilers support ""d and ""y at this time.
487-
#if _LIBCPP_CLANG_VER < 800 || defined(__apple_build_version__)
483+
#if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 800) || defined(__apple_build_version__)
488484
#define _LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS
489485
#endif
490486

@@ -1242,7 +1238,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
12421238

12431239
#ifndef _LIBCPP_NODEBUG_TYPE
12441240
#if __has_attribute(__nodebug__) && \
1245-
(defined(_LIBCPP_COMPILER_CLANG) && _LIBCPP_CLANG_VER >= 900)
1241+
(defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 900)
12461242
#define _LIBCPP_NODEBUG_TYPE __attribute__((nodebug))
12471243
#else
12481244
#define _LIBCPP_NODEBUG_TYPE

0 commit comments

Comments
 (0)