Commit e48849a2 authored by Billy Robert O'Neal III's avatar Billy Robert O'Neal III
Browse files

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

parent 837d8129
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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();

+7 −0
Original line number Diff line number Diff line
@@ -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 {};