From b8c0e16eeb7496f71480c6a060144b0e050edcf5 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Tue, 12 Apr 2011 20:36:11 +0000 Subject: Fixes Sun C++ compiler errors (by Pasi Valminen) --- test/gtest-printers_test.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc index 1395c69b..6292c7f2 100644 --- a/test/gtest-printers_test.cc +++ b/test/gtest-printers_test.cc @@ -857,7 +857,7 @@ TEST(PrintStlContainerTest, HashMultiSet) { #endif // GTEST_HAS_HASH_SET_ TEST(PrintStlContainerTest, List) { - const char* a[] = { + const string a[] = { "hello", "world" }; @@ -875,9 +875,15 @@ TEST(PrintStlContainerTest, Map) { TEST(PrintStlContainerTest, MultiMap) { multimap map1; - map1.insert(make_pair(true, 0)); - map1.insert(make_pair(true, 1)); - map1.insert(make_pair(false, 2)); + // The make_pair template function would deduce the type as + // pair here, and since the key part in a multimap has to + // be constant, without a templated ctor in the pair class (as in + // libCstd on Solaris), make_pair call would fail to compile as no + // implicit conversion is found. Thus explicit typename is used + // here instead. + map1.insert(pair(true, 0)); + map1.insert(pair(true, 1)); + map1.insert(pair(false, 2)); EXPECT_EQ("{ (false, 2), (true, 0), (true, 1) }", Print(map1)); } -- cgit v1.2.3