diff options
author | Joshua Cannon <joshdcannon@gmail.com> | 2019-10-07 21:27:11 (GMT) |
---|---|---|
committer | Joshua Cannon <joshdcannon@gmail.com> | 2019-10-07 21:27:11 (GMT) |
commit | 20255e6f40995f03c808a0589ea92c52a26552cd (patch) | |
tree | 36b9865e5f7cb606ea4c046b741380eba77c641a /googlemock | |
parent | 7f8617a7c53275654531e3c75fe11bc9b1b7e1a1 (diff) | |
download | googletest-20255e6f40995f03c808a0589ea92c52a26552cd.zip googletest-20255e6f40995f03c808a0589ea92c52a26552cd.tar.gz googletest-20255e6f40995f03c808a0589ea92c52a26552cd.tar.bz2 |
Use declval in noexcept expression
Diffstat (limited to 'googlemock')
-rw-r--r-- | googlemock/test/gmock-function-mocker_test.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/googlemock/test/gmock-function-mocker_test.cc b/googlemock/test/gmock-function-mocker_test.cc index 94f01fe..f493c72 100644 --- a/googlemock/test/gmock-function-mocker_test.cc +++ b/googlemock/test/gmock-function-mocker_test.cc @@ -42,6 +42,7 @@ #include <map> #include <string> +#include <type_traits> #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -669,13 +670,13 @@ struct MockMethodNoexceptSpecifier { }; TEST(MockMethodMockFunctionTest, NoexceptSpecifierPreserved) { - EXPECT_TRUE(noexcept(MockMethodNoexceptSpecifier{}.func1())); - EXPECT_TRUE(noexcept(MockMethodNoexceptSpecifier{}.func2())); - EXPECT_FALSE(noexcept(MockMethodNoexceptSpecifier{}.func3())); - EXPECT_EQ(noexcept(MockMethodNoexceptSpecifier{}.func4()), noexcept(1+1)); - EXPECT_EQ(noexcept(MockMethodNoexceptSpecifier{}.func5()), noexcept(1+1)); - EXPECT_EQ(noexcept(MockMethodNoexceptSpecifier{}.func6()), noexcept(1+1)); - EXPECT_EQ(noexcept(MockMethodNoexceptSpecifier{}.func7()), noexcept(hasTwoParams(1,2))); + EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func1())); + EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func2())); + EXPECT_FALSE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func3())); + EXPECT_EQ(noexcept(std::declval<MockMethodNoexceptSpecifier>().func4()), noexcept(1+1)); + EXPECT_EQ(noexcept(std::declval<MockMethodNoexceptSpecifier>().func5()), noexcept(1+1)); + EXPECT_EQ(noexcept(std::declval<MockMethodNoexceptSpecifier>().func6()), noexcept(1+1)); + EXPECT_EQ(noexcept(std::declval<MockMethodNoexceptSpecifier>().func7()), noexcept(hasTwoParams(1,2))); } } // namespace gmock_function_mocker_test |