Skip to content

Commit 3e3c81c

Browse files
authored
Merge pull request #6886 from hughbe/module-static_assert
2 parents 8a2b523 + cd8427e commit 3e3c81c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/AST/Module.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "swift/AST/ReferencedNameTracker.h"
3030
#include "swift/AST/PrettyStackTrace.h"
3131
#include "swift/AST/PrintOptions.h"
32-
#include "swift/Basic/Compiler.h"
3332
#include "swift/Basic/SourceManager.h"
3433
#include "clang/Basic/Module.h"
3534
#include "llvm/ADT/DenseMap.h"
@@ -842,10 +841,10 @@ namespace {
842841

843842
template <typename T>
844843
struct OperatorLookup {
845-
// TODO: this assertion fails in MSVC, but not clang-cl.
846-
#if !SWIFT_COMPILER_IS_MSVC
847-
static_assert(static_cast<T*>(nullptr), "Only usable with operators");
848-
#endif
844+
// Don't fold this into the static_assert: this would trigger an MSVC bug
845+
// that causes the assertion to fail.
846+
static constexpr T* ptr = static_cast<T*>(nullptr);
847+
static_assert(ptr, "Only usable with operators");
849848
};
850849

851850
template <>

0 commit comments

Comments
 (0)