If we are in MSVC 2015 compatibility mode and C++11 language conformance
is enabled, define _HAS_CHAR16_T_LANGUAGE_SUPPORT to 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232615
91177308-0d34-0410-b5e6-
96231b3b80d8
Builder.defineMacro("_MSC_FULL_VER", Twine(Opts.MSCompatibilityVersion));
// FIXME We cannot encode the revision information into 32-bits
Builder.defineMacro("_MSC_BUILD", Twine(1));
+
+ if (Opts.CPlusPlus11 && Opts.isCompatibleWithMSVC(19))
+ Builder.defineMacro("_HAS_CHAR16_T_LANGUAGE_SUPPORT", Twine(1));
}
if (Opts.MicrosoftExt) {
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions -fms-compatibility-version=19.00
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions -fms-compatibility-version=18.00
-#if _MSC_VER >= 1900
+#if defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT
char16_t x;
char32_t y;
-_Atomic(int) z;
#else
typedef unsigned short char16_t;
typedef unsigned int char32_t;
+#endif
+
+#if _MSC_VER >= 1900
+_Atomic(int) z;
+#else
struct _Atomic {};
#endif