diff options
author | Abseil Team <absl-team@google.com> | 2020-11-12 16:12:19 (GMT) |
---|---|---|
committer | Mark Barolak <mbar@google.com> | 2020-11-12 18:32:33 (GMT) |
commit | a1adec799a3252016dabce83f8effcebc51b8050 (patch) | |
tree | cfbc0066227136d6c1c2cc9b186e9d6096578dfb /googletest/test | |
parent | e7ed50fd137dd7626bbb21dfc41982454dcff69b (diff) | |
download | googletest-a1adec799a3252016dabce83f8effcebc51b8050.zip googletest-a1adec799a3252016dabce83f8effcebc51b8050.tar.gz googletest-a1adec799a3252016dabce83f8effcebc51b8050.tar.bz2 |
Googletest export
Use a tagged constructor for FlatTuple instead.
Some versions of MSVC are getting confused with that constructor and generating invalid code.
PiperOrigin-RevId: 342050957
Diffstat (limited to 'googletest/test')
-rw-r--r-- | googletest/test/gtest_unittest.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index d08f917..ac0f179 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -7555,7 +7555,8 @@ TEST(FlatTuple, Basic) { EXPECT_EQ(0.0, tuple.Get<1>()); EXPECT_EQ(nullptr, tuple.Get<2>()); - tuple = FlatTuple<int, double, const char*>(7, 3.2, "Foo"); + tuple = FlatTuple<int, double, const char*>( + testing::internal::FlatTupleConstructTag{}, 7, 3.2, "Foo"); EXPECT_EQ(7, tuple.Get<0>()); EXPECT_EQ(3.2, tuple.Get<1>()); EXPECT_EQ(std::string("Foo"), tuple.Get<2>()); @@ -7573,7 +7574,8 @@ std::string AddIntToString(int i, const std::string& s) { TEST(FlatTuple, Apply) { using testing::internal::FlatTuple; - FlatTuple<int, std::string> tuple{5, "Hello"}; + FlatTuple<int, std::string> tuple{testing::internal::FlatTupleConstructTag{}, + 5, "Hello"}; // Lambda. EXPECT_TRUE(tuple.Apply([](int i, const std::string& s) -> bool { @@ -7647,7 +7649,8 @@ TEST(FlatTuple, ConstructorCalls) { ConstructionCounting::Reset(); { ConstructionCounting elem; - FlatTuple<ConstructionCounting> tuple{elem}; + FlatTuple<ConstructionCounting> tuple{ + testing::internal::FlatTupleConstructTag{}, elem}; } EXPECT_EQ(ConstructionCounting::default_ctor_calls, 1); EXPECT_EQ(ConstructionCounting::dtor_calls, 2); @@ -7658,7 +7661,10 @@ TEST(FlatTuple, ConstructorCalls) { // Move construction. ConstructionCounting::Reset(); - { FlatTuple<ConstructionCounting> tuple{ConstructionCounting{}}; } + { + FlatTuple<ConstructionCounting> tuple{ + testing::internal::FlatTupleConstructTag{}, ConstructionCounting{}}; + } EXPECT_EQ(ConstructionCounting::default_ctor_calls, 1); EXPECT_EQ(ConstructionCounting::dtor_calls, 2); EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 0); |