@@ -2356,6 +2356,15 @@ class BeginEndDistanceIsMatcher {
2356
2356
template <typename Container>
2357
2357
class Impl : public MatcherInterface <Container> {
2358
2358
public:
2359
+ // LLVM local change to support std::begin/std::end.
2360
+ //
2361
+ // typedef internal::StlContainerView<GTEST_REMOVE_REFERENCE_AND_CONST_(
2362
+ // Container)>
2363
+ // ContainerView;
2364
+ // typedef typename std::iterator_traits<
2365
+ // typename ContainerView::type::const_iterator>::difference_type
2366
+ // DistanceType;
2367
+ //
2359
2368
typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (Container) RawContainer;
2360
2369
typedef internal::StlContainerView<RawContainer> View;
2361
2370
typedef typename View::type StlContainer;
@@ -2364,12 +2373,7 @@ class BeginEndDistanceIsMatcher {
2364
2373
std::declval<StlContainerReference>())) StlContainerConstIterator;
2365
2374
typedef typename std::iterator_traits<
2366
2375
StlContainerConstIterator>::difference_type DistanceType;
2367
- // typedef internal::StlContainerView<GTEST_REMOVE_REFERENCE_AND_CONST_(
2368
- // Container)>
2369
- // ContainerView;
2370
- // typedef typename std::iterator_traits<
2371
- // typename ContainerView::type::const_iterator>::difference_type
2372
- // DistanceType;
2376
+ // LLVM local change end.
2373
2377
explicit Impl (const DistanceMatcher& distance_matcher)
2374
2378
: distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
2375
2379
@@ -3378,11 +3382,16 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
3378
3382
typedef internal::StlContainerView<RawContainer> View;
3379
3383
typedef typename View::type StlContainer;
3380
3384
typedef typename View::const_reference StlContainerReference;
3385
+
3386
+ // LLVM local change to support std::begin/std::end.
3387
+ //
3388
+ // typedef typename StlContainer::value_type Element;
3389
+ //
3381
3390
typedef decltype (std::begin(
3382
3391
std::declval<StlContainerReference>())) StlContainerConstIterator;
3383
3392
typedef typename std::remove_reference<
3384
3393
decltype (*std::declval<StlContainerConstIterator &>())>::type Element;
3385
- // typedef typename StlContainer::value_type Element;
3394
+ // LLVM local change end.
3386
3395
3387
3396
// Constructs the matcher from a sequence of element values or
3388
3397
// element matchers.
@@ -3439,7 +3448,12 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
3439
3448
// explanations[i] is the explanation of the element at index i.
3440
3449
::std::vector<std::string> explanations (count ());
3441
3450
StlContainerReference stl_container = View::ConstReference (container);
3451
+ // LLVM local change to support std::begin/std::end.
3452
+ //
3453
+ // auto it = stl_container.begin();
3454
+ //
3442
3455
StlContainerConstIterator it = stl_container.begin ();
3456
+ // LLVM local change end.
3443
3457
size_t exam_pos = 0 ;
3444
3458
bool mismatch_found = false ; // Have we found a mismatched element yet?
3445
3459
@@ -3628,12 +3642,14 @@ class UnorderedElementsAreMatcherImpl
3628
3642
typedef internal::StlContainerView<RawContainer> View;
3629
3643
typedef typename View::type StlContainer;
3630
3644
typedef typename View::const_reference StlContainerReference;
3645
+ // LLVM local change to support std::begin/std::end.
3646
+ //
3647
+ // typedef typename StlContainer::value_type Element;
3631
3648
typedef decltype (std::begin(
3632
3649
std::declval<StlContainerReference>())) StlContainerConstIterator;
3633
3650
typedef typename std::remove_reference<
3634
3651
decltype (*std::declval<StlContainerConstIterator &>())>::type Element;
3635
- // typedef typename StlContainer::value_type Element;
3636
-
3652
+ // LLVM local change end.
3637
3653
template <typename InputIter>
3638
3654
UnorderedElementsAreMatcherImpl (UnorderedMatcherRequire::Flags matcher_flags,
3639
3655
InputIter first, InputIter last)
@@ -3720,15 +3736,18 @@ class UnorderedElementsAreMatcher {
3720
3736
template <typename Container>
3721
3737
operator Matcher<Container>() const {
3722
3738
typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (Container) RawContainer;
3723
-
3739
+ // LLVM local change to support std::begin/std::end.
3740
+ //
3741
+ // typedef typename internal::StlContainerView<RawContainer>::type View;
3742
+ // typedef typename View::value_type Element;
3743
+ //
3724
3744
typedef internal::StlContainerView<RawContainer> View;
3725
3745
typedef typename View::const_reference StlContainerReference;
3726
3746
typedef decltype (std::begin (
3727
3747
std::declval<StlContainerReference>())) StlContainerConstIterator;
3728
3748
typedef typename std::remove_reference<
3729
3749
decltype (*std::declval<StlContainerConstIterator &>())>::type Element;
3730
- // typedef typename internal::StlContainerView<RawContainer>::type View;
3731
- // typedef typename View::value_type Element;
3750
+ // LLVM local change end.
3732
3751
typedef ::std::vector<Matcher<const Element&>> MatcherVec;
3733
3752
MatcherVec matchers;
3734
3753
matchers.reserve (::std::tuple_size<MatcherTuple>::value);
@@ -3758,14 +3777,18 @@ class ElementsAreMatcher {
3758
3777
" use UnorderedElementsAre with hash tables" );
3759
3778
3760
3779
typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (Container) RawContainer;
3780
+ // LLVM local change to support std::begin/std::end.
3781
+ //
3782
+ // typedef typename internal::StlContainerView<RawContainer>::type View;
3783
+ // typedef typename View::value_type Element;
3784
+ //
3761
3785
typedef internal::StlContainerView<RawContainer> View;
3762
3786
typedef typename View::const_reference StlContainerReference;
3763
3787
typedef decltype (std::begin (
3764
3788
std::declval<StlContainerReference>())) StlContainerConstIterator;
3765
3789
typedef typename std::remove_reference<
3766
3790
decltype (*std::declval<StlContainerConstIterator &>())>::type Element;
3767
- // typedef typename internal::StlContainerView<RawContainer>::type View;
3768
- // typedef typename View::value_type Element;
3791
+ // LLVM local change end.
3769
3792
typedef ::std::vector<Matcher<const Element&>> MatcherVec;
3770
3793
MatcherVec matchers;
3771
3794
matchers.reserve (::std::tuple_size<MatcherTuple>::value);
0 commit comments