Skip to content

Commit a121762

Browse files
committed
[unittests] Use std::make_tuple to make some toolchains happy again
My toolchain stopped working (LLVM 8.0, libstdc++ 5.4.0) after 577adda: 06:25:37 ../unittests/Support/Path.cpp:91:7: error: chosen constructor is explicit in copy-initialization 06:25:37 {"", false, false}, {"/", true, true}, {"/foo", true, true}, 06:25:37 ^~~~~~~~~~~~~~~~~~ 06:25:37 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here 06:25:37 constexpr tuple(_UElements&&... __elements) 06:25:37 ^ This commit adds explicit calls to std::make_tuple to work around the problem.
1 parent 8cc842a commit a121762

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

llvm/unittests/Support/Path.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,19 @@ TEST(is_separator, Works) {
8888
TEST(is_absolute_gnu, Works) {
8989
// Test tuple <Path, ExpectedPosixValue, ExpectedWindowsValue>.
9090
const std::tuple<StringRef, bool, bool> Paths[] = {
91-
{"", false, false}, {"/", true, true}, {"/foo", true, true},
92-
{"\\", false, true}, {"\\foo", false, true}, {"foo", false, false},
93-
{"c", false, false}, {"c:", false, true}, {"c:\\", false, true},
94-
{"!:", false, true}, {"xx:", false, false}, {"c:abc\\", false, true},
95-
{":", false, false}};
91+
std::make_tuple("", false, false),
92+
std::make_tuple("/", true, true),
93+
std::make_tuple("/foo", true, true),
94+
std::make_tuple("\\", false, true),
95+
std::make_tuple("\\foo", false, true),
96+
std::make_tuple("foo", false, false),
97+
std::make_tuple("c", false, false),
98+
std::make_tuple("c:", false, true),
99+
std::make_tuple("c:\\", false, true),
100+
std::make_tuple("!:", false, true),
101+
std::make_tuple("xx:", false, false),
102+
std::make_tuple("c:abc\\", false, true),
103+
std::make_tuple(":", false, false)};
96104

97105
for (const auto &Path : Paths) {
98106
EXPECT_EQ(path::is_absolute_gnu(std::get<0>(Path), path::Style::posix),

0 commit comments

Comments
 (0)