diff --git a/tools/clang/unittests/HLSL/DxilContainerTest.cpp b/tools/clang/unittests/HLSL/DxilContainerTest.cpp index 5869923802..82a833535a 100644 --- a/tools/clang/unittests/HLSL/DxilContainerTest.cpp +++ b/tools/clang/unittests/HLSL/DxilContainerTest.cpp @@ -36,13 +36,23 @@ #include #include #pragma comment(lib, "d3dcompiler.lib") -#if _MSC_VER >= 1920 -#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING -#include -#else -#include #endif + +#if defined(_MSC_VER) + // MSVC removed starting in VS 2019 16.3 (_MSC_VER >= 1922) + #if (_MSC_VER >= 1920) && (_MSC_VER < 1922) + #include + namespace fs = std::experimental::filesystem; + #else + #include + namespace fs = std::filesystem; + #endif +#else + #include + namespace fs = std::filesystem; #endif + +using namespace fs; #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" @@ -72,8 +82,6 @@ using namespace std; using namespace hlsl_test; #ifdef _WIN32 -using namespace std::experimental::filesystem; - static uint8_t MaskCount(uint8_t V) { DXASSERT_NOMSG(0 <= V && V <= 0xF); static const uint8_t Count[16] = {0, 1, 1, 2, 1, 2, 2, 3,