diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-06-16 03:54:11 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-06-16 03:54:11 +0000 |
commit | 7027ba92dd7381188d3014d2ae1d9bedef9a218e (patch) | |
tree | 05ad83d18c9895e3e7b2576596445e18f5e11fe5 /unittests/ADT/DenseMapTest.cpp | |
parent | 06e6c385cbf550ab73ad70bd3e02d9ad2fd3089c (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT/DenseMapTest.cpp')
-rw-r--r-- | unittests/ADT/DenseMapTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/ADT/DenseMapTest.cpp b/unittests/ADT/DenseMapTest.cpp index e04bba7622..3fe35c91ed 100644 --- a/unittests/ADT/DenseMapTest.cpp +++ b/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 |