mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Guard a static assert for MSVC
MSVC doens't pack diffrent underlying int types into a bitfield. e.g.
struct S {
int a: 1;
char b: 1;
int c: 1;
};
These fields are considered three sparate bitfields.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "swift/AST/DiagnosticsParse.h"
|
||||
#include "swift/AST/DiagnosticsFrontend.h"
|
||||
#include "swift/AST/DiagnosticsSIL.h"
|
||||
#include "swift/Basic/Compiler.h"
|
||||
#include "swift/Basic/SourceManager.h"
|
||||
#include "swift/Demangling/ManglingUtils.h"
|
||||
#include "swift/Frontend/Frontend.h"
|
||||
@@ -608,7 +609,13 @@ struct SwiftSemanticToken {
|
||||
return SwiftLangSupport::getUIDForCodeCompletionDeclKind(Kind, getIsRef());
|
||||
}
|
||||
};
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#else
|
||||
static_assert(sizeof(SwiftSemanticToken) == 8, "Too big");
|
||||
// FIXME: MSVC doesn't pack bitfields with different underlying types.
|
||||
// Giving up to check this in MSVC for now, becasue static_assert is only for
|
||||
// keeping low memory usage.
|
||||
#endif
|
||||
|
||||
class SwiftDocumentSemanticInfo :
|
||||
public ThreadSafeRefCountedBase<SwiftDocumentSemanticInfo> {
|
||||
|
||||
Reference in New Issue
Block a user