aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/DenseMapTest.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-06-16 03:54:11 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-06-16 03:54:11 +0000
commita68dcb448ab99e59261a37ab1adf21724ee5fe71 (patch)
tree3c72a38e2021c13146dbb0d8f9bd9bed64f4904a /llvm/unittests/ADT/DenseMapTest.cpp
parent5d3fb22baceef03641b8e051cdbd497ee293bbaf (diff)
downloadllvm-a68dcb448ab99e59261a37ab1adf21724ee5fe71.zip
llvm-a68dcb448ab99e59261a37ab1adf21724ee5fe71.tar.gz
llvm-a68dcb448ab99e59261a37ab1adf21724ee5fe71.tar.bz2
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
Diffstat (limited to 'llvm/unittests/ADT/DenseMapTest.cpp')
-rw-r--r--llvm/unittests/ADT/DenseMapTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp
index e04bba7..3fe35c9 100644
--- a/llvm/unittests/ADT/DenseMapTest.cpp
+++ b/llvm/unittests/ADT/DenseMapTest.cpp
@@ -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