From: Zachary Turner Date: Fri, 17 Mar 2017 00:16:21 +0000 (+0000) Subject: Don't rely on an implicit std::tuple constructor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a965f8ecd3f7a78b43a5460c4a0a53a467e020d;p=llvm Don't rely on an implicit std::tuple constructor. Apparently it doesn't have one, so using an initializer list doesn't work correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298018 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp index cfd448b5fc9..042cd1eef08 100644 --- a/unittests/Support/Path.cpp +++ b/unittests/Support/Path.cpp @@ -1054,10 +1054,15 @@ TEST_F(FileSystemTest, FileMapping) { } TEST(Support, NormalizePath) { - using TestTuple = std::tuple; - TestTuple Tests[] = {{"a", "a", "a"}, {"a/b", "a\\b", "a/b"}, - {"a\\b", "a\\b", "a/b"}, {"a\\\\b", "a\\\\b", "a\\\\b"}, - {"\\a", "\\a", "/a"}, {"a\\", "a\\", "a/"}}; + using TestTuple = std::tuple; + std::vector Tests; + Tests.emplace_back("a", "a", "a"); + Tests.emplace_back("a/b", "a\\b", "a/b"); + Tests.emplace_back("a\\b", "a\\b", "a/b"); + Tests.emplace_back("a\\\\b", "a\\\\b", "a\\\\b"); + Tests.emplace_back("\\a", "\\a", "/a"); + Tests.emplace_back("a\\", "a\\", "a/"); + for (auto &T : Tests) { SmallString<64> Win = std::get<0>(T); SmallString<64> Posix = Win;