[libcxx-commits] [libcxx] a668ad9 - [libc++][test] MSVC has no __PRETTY_FUNCTION__

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 19 17:21:11 PDT 2020


Author: Casey Carter
Date: 2020-10-19T17:20:47-07:00
New Revision: a668ad92d5e2161e07e1a435a19ea5072f52a989

URL: https://github.com/llvm/llvm-project/commit/a668ad92d5e2161e07e1a435a19ea5072f52a989
DIFF: https://github.com/llvm/llvm-project/commit/a668ad92d5e2161e07e1a435a19ea5072f52a989.diff

LOG: [libc++][test] MSVC has no __PRETTY_FUNCTION__

Use `__FUNCSIG__` instead when compiling with MSVC. While we're touching `makeTypeIDImp`, remove the warning suppression for C4640 "construction of local static object is not thread safe" since C1XX now correctly constant-initializes `id`.

Added: 
    

Modified: 
    libcxx/test/support/type_id.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/type_id.h b/libcxx/test/support/type_id.h
index 68bc98d5bd3c..0450b8836813 100644
--- a/libcxx/test/support/type_id.h
+++ b/libcxx/test/support/type_id.h
@@ -42,18 +42,15 @@ struct TypeID {
 };
 
 // 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() {
+#ifdef _MSC_VER
+  static const TypeID id(__FUNCSIG__);
+#else
   static const TypeID id(__PRETTY_FUNCTION__);
+#endif // _MSC_VER
   return id;
 }
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
 
 template <class T>
 struct TypeWrapper {};


        


More information about the libcxx-commits mailing list