Disabling a spurious deprecation warning about using PathV1 from within the PathV1...
authorAaron Ballman <aaron@aaronballman.com>
Sat, 9 Jun 2012 13:59:29 +0000 (13:59 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Sat, 9 Jun 2012 13:59:29 +0000 (13:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158274 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/Path.inc

index 146d6b398519318d483526ab8ee0746d491ee20a..2280b3417145410ba448c3ee9566d22042571b3d 100644 (file)
@@ -189,7 +189,17 @@ static Path *TempDirectory;
 Path
 Path::GetTemporaryDirectory(std::string* ErrMsg) {
   if (TempDirectory) {
+#if defined(_MSC_VER)
+    // Visual Studio gets confused and emits a diagnostic about calling exists,
+    // even though this is the implementation for PathV1.  Temporarily 
+    // disable the deprecated warning message
+    #pragma warning(push)
+    #pragma warning(disable:4996)
+#endif
     assert(TempDirectory->exists() && "Who has removed TempDirectory?");
+#if defined(_MSC_VER)
+    #pragma warning(pop)
+#endif
     return *TempDirectory;
   }