diff options
Diffstat (limited to 'include/gmock/gmock-generated-matchers.h')
-rw-r--r-- | include/gmock/gmock-generated-matchers.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/gmock/gmock-generated-matchers.h b/include/gmock/gmock-generated-matchers.h index b2d55768..a59e457f 100644 --- a/include/gmock/gmock-generated-matchers.h +++ b/include/gmock/gmock-generated-matchers.h @@ -304,11 +304,15 @@ class ElementsAreMatcher1 { typedef typename internal::StlContainerView<RawContainer>::type::value_type Element; - const Matcher<const Element&> matchers[] = { - MatcherCast<const Element&>(e1_), - }; - - return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 1)); + // Nokia's Symbian Compiler has a nasty bug where the object put + // in a one-element local array is not destructed when the array + // goes out of scope. This leads to obvious badness as we've + // added the linked_ptr in it to our other linked_ptrs list. + // Hence we implement ElementsAreMatcher1 specially to avoid using + // a local array. + const Matcher<const Element&> matcher = + MatcherCast<const Element&>(e1_); + return MakeMatcher(new ElementsAreMatcherImpl<Container>(&matcher, 1)); } private: |