1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Work around a bug with MSVC 10 where it fails to recognize a valid use

of typename. GCC and Clang were fine with this, but MSVC won't accept
it. Fortunately, it also doesn't need it. Yuck.

Thanks to Nakamura for pointing this out in IRC.

llvm-svn: 158593
This commit is contained in:
Chandler Carruth 2012-06-16 03:54:11 +00:00
parent f0846e363a
commit 6516b04810

View File

@ -66,8 +66,17 @@ TYPED_TEST(DenseMapTest, EmptyIntMapTest) {
// Lookup tests
EXPECT_FALSE(this->Map.count(this->getKey()));
EXPECT_TRUE(this->Map.find(this->getKey()) == this->Map.end());
#ifndef _MSC_VER
EXPECT_EQ(typename TypeParam::mapped_type(),
this->Map.lookup(this->getKey()));
#else
// MSVC, at least old versions, cannot parse the typename to disambiguate
// TypeParam::mapped_type as a type. However, because MSVC doesn't implement
// two-phase name lookup, it also doesn't require the typename. Deal with
// this mutual incompatibility through specialized code.
EXPECT_EQ(TypeParam::mapped_type(),
this->Map.lookup(this->getKey()));
#endif
}
// Constant map tests