diff options
author | kuzkry <krystian.kuzniarek@gmail.com> | 2019-09-16 01:46:55 -0400 |
---|---|---|
committer | Shaindel Schwartz <shaindel@google.com> | 2019-09-16 11:47:35 -0400 |
commit | f2fb48c3b3d79a75a88a99fba6576b25d42ec528 (patch) | |
tree | e0e97e09100ca73573c192952ac5fb2a9194727c /googlemock/include/gmock/internal/gmock-internal-utils.h | |
parent | cad3bc46c2ba8ec0bd7bb252d7279fe791140fbf (diff) | |
download | googletest-f2fb48c3b3d79a75a88a99fba6576b25d42ec528.tar.gz googletest-f2fb48c3b3d79a75a88a99fba6576b25d42ec528.tar.bz2 googletest-f2fb48c3b3d79a75a88a99fba6576b25d42ec528.zip |
Googletest export
Merge 3bdefdb473d304803d2a38e2a2cd5cdc1827c3bd into fb49e6c164490a227bbb7cf5223b846c836a0305
Closes #2407
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2407 from kuzkry:StaticAssertTypeEq 3bdefdb473d304803d2a38e2a2cd5cdc1827c3bd
PiperOrigin-RevId: 269255328
Diffstat (limited to 'googlemock/include/gmock/internal/gmock-internal-utils.h')
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index e05b8835..fdc049c5 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -384,9 +384,8 @@ class StlContainerView { typedef const type& const_reference; static const_reference ConstReference(const RawContainer& container) { - // Ensures that RawContainer is not a const type. - testing::StaticAssertTypeEq< - RawContainer, typename std::remove_const<RawContainer>::type>(); + static_assert(!std::is_const<RawContainer>::value, + "RawContainer type must not be const"); return container; } static type Copy(const RawContainer& container) { return container; } @@ -406,8 +405,8 @@ class StlContainerView<Element[N]> { typedef const type const_reference; static const_reference ConstReference(const Element (&array)[N]) { - // Ensures that Element is not a const type. - testing::StaticAssertTypeEq<Element, RawElement>(); + static_assert(std::is_same<Element, RawElement>::value, + "Element type must not be const"); return type(array, N, RelationToSourceReference()); } static type Copy(const Element (&array)[N]) { |