-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2015/2017 build fix and enable C++11 features (attempt number three) #1218
Conversation
e8d0c29
to
01d854c
Compare
90e9f40
to
8943d1c
Compare
8943d1c
to
cfa5afc
Compare
My build process has been cloning from your branches for months. Thanks for making gtest work in VS. |
4e212f0
to
64ddc5a
Compare
@gennadiycivil Can we move forward with this PR? |
64ddc5a
to
9c1bb54
Compare
I started a review but did not get any answers... |
Did you send questions to me? Perhaps you forgot to click the |
@@ -120,21 +120,21 @@ TEST(ArgsTest, AcceptsOneTemplateArg) { | |||
} | |||
|
|||
TEST(ArgsTest, AcceptsTwoTemplateArgs) { | |||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT | |||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Please explain static_cast and exactly why its needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line produces warning tuple(165): warning C4244: 'initializing': conversion from 'int' to 'short', possible loss of data
and because of -WX
compiler produce errors for warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same bellow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same change was proposed in #1136
|
||
EXPECT_THAT(t, (Args<0, 1>(Lt()))); | ||
EXPECT_THAT(t, (Args<1, 2>(Lt()))); | ||
EXPECT_THAT(t, Not(Args<0, 2>(Gt()))); | ||
} | ||
|
||
TEST(ArgsTest, AcceptsRepeatedTemplateArgs) { | ||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT | ||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Please explain static_cast and exactly why its needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPECT_THAT(t, (Args<0, 0>(Eq()))); | ||
EXPECT_THAT(t, Not(Args<1, 1>(Ne()))); | ||
} | ||
|
||
TEST(ArgsTest, AcceptsDecreasingTemplateArgs) { | ||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT | ||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -159,7 +159,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) { | |||
} | |||
|
|||
TEST(ArgsTest, CanBeNested) { | |||
const tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT | |||
const tuple<short, int, long, int> t(static_cast<short>(4), 5, 6L, 6); // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -58,6 +58,11 @@ | |||
# include <forward_list> // NOLINT | |||
#endif | |||
|
|||
// Disable MSVC2015 warning for std::pair: "decorated name length exceeded, name was truncated". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really only apply to 2015? What happens in 2017? I would want to see test results for both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes fix compiler warning:
9c1bb54
I'll check that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS 2015 produce this error:
7>D:\Work\googletest\googlemock\test\gmock-matchers_test.cc(5683): error C2220: warning treated as error - no 'object' file generated [D:\Work\goo
gletest\build\Win32\googlemock\gmock-matchers_test.vcxproj]
7>D:\Work\googletest\googlemock\test\gmock-matchers_test.cc(5683): warning C4503: 'std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std
::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<He
ad,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::p
air<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,
std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair
<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Head,std::pair<Matcher1,Matcher2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>::pair': decorated name length exceeded, name was truncated [D:\Work\googletest\build\Win32\googlemock\gmock-matchers_test.vcxproj]
with
[
Head=testing::internal::NeMatcher<int>,
Matcher1=testing::internal::NeMatcher<int>,
Matcher2=testing::internal::NeMatcher<int>
]
VS2017 compile gtest without warnings (maybe because of variadic templates)
Oh yes, thank you this is exactly what I did(not) do |
9c1bb54
to
c08d35a
Compare
AppVeyor build failed - here |
c08d35a
to
840c711
Compare
@gennadiycivil This should be now fixed |
Hooray 🎉🎉🎉 |
The original gtest folder is removed. Reason is the removed namespace std::tr1 no longer available in the VS2017. Fixed in PR google/googletest#1218 and the related issue is google/googletest#1138
The original gtest folder is removed. Reason is the removed namespace std::tr1 no longer available in the VS2017. Fixed in PR google/googletest#1218 and the related issue is google/googletest#1138
The original gtest folder is removed. Reason is the removed namespace std::tr1 no longer available in the VS2017. Fixed in PR google/googletest#1218 and the related issue is google/googletest#1138
Allow use C++11 features available in VS2015/2017, fix failed tests with GMock under VC++2015 compiler
This is rebased PR #811
I have been trying to merge this change since February 2016 (PR #723)