[libcxx] [test] Suppress MSVC++ warning 4640 under /Zc:threadSafeInit-

This commit is contained in:
Billy Robert O'Neal III 2020-02-22 06:57:37 -08:00
parent 837d8129e9
commit e48849a240
2 changed files with 14 additions and 0 deletions

View File

@ -347,10 +347,17 @@ public:
const bool MemCounter::disable_checking = false;
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4640) // '%s' construction of local static object is not thread safe (/Zc:threadSafeInit-)
#endif // _MSC_VER
inline MemCounter* getGlobalMemCounter() {
static MemCounter counter((MemCounter::MemCounterCtorArg_()));
return &counter;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
MemCounter &globalMemCounter = *getGlobalMemCounter();

View File

@ -49,11 +49,18 @@ private:
};
// makeTypeID - Return the TypeID for the specified type 'T'.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4640) // '%s' construction of local static object is not thread safe (/Zc:threadSafeInit-)
#endif // _MSC_VER
template <class T>
inline TypeID const& makeTypeIDImp() {
static const TypeID id(typeid(T).name());
return id;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <class T>
struct TypeWrapper {};