Skip to content

Commit 46e5c5f

Browse files
committed
[ManagedStatic] Fix build errors with clang-tblgen in Debug mode using MSVC 2019 v16.6
After updating MSVS19 from v16.4 to v16.6 I faced with a build errors compiling in Debug mode. It complains on clang-tblgen.exe and llvm-tblgen.exe cmd line args. VS compiler had a bug. It dynamically creates an object with constexpr ctor in Debug mode. This bug was fixed in VS2019 v16.5. A workaround was implemented for that and everything works until v16.5 comes. The workaround became irrelevant since v16.5 and caused build errors. So I disabled the workaround for VS2019 v16.5 and higher. This relates to http://llvm.org/PR41367. Differential Revision: https://reviews.llvm.org/D80433
1 parent 356bf5e commit 46e5c5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/ManagedStatic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ template <typename T, size_t N> struct object_deleter<T[N]> {
4040
// constexpr, a dynamic initializer may be emitted depending on optimization
4141
// settings. For the affected versions of MSVC, use the old linker
4242
// initialization pattern of not providing a constructor and leaving the fields
43-
// uninitialized.
44-
#if !defined(_MSC_VER) || defined(__clang__)
43+
// uninitialized. See http://llvm.org/PR41367 for details.
44+
#if !defined(_MSC_VER) || (_MSC_VER >= 1925) || defined(__clang__)
4545
#define LLVM_USE_CONSTEXPR_CTOR
4646
#endif
4747

0 commit comments

Comments
 (0)