-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Use override keyword with new C++11 compilers #533
Comments
From @GoogleCodeExporter on August 24, 2015 22:40 Original comment by
|
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by Attachments: |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40 Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
From @GoogleCodeExporter on August 24, 2015 22:40
Original comment by |
By not using -Wsuggest-override (with warnings as errors), though it is wonderfully useful, because googletest doesn't use the override keyword yet: google/googletest#533
Just got hit by this. A couple of hours wasted. :( |
Because it doesn't use the override keyword: google/googletest#533
I agree. How has this argument been going on for 1.5 years? Does anybody actually maintain this project anymore? Are there more active forks? Maybe ones that support C++11 and beyond? |
It's been discussed here in the past, with the arguments against it laid
out. can't search right now.
…On Thu, Feb 23, 2017 at 10:49 AM Edwin Vane ***@***.***> wrote:
I agree. How has this argument been going on for 1.5 years? Does anybody
actually maintain this project anymore?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#533 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AINnROlvX6rB_6dfeFgdO2z96rNtZdYHks5rfaqigaJpZM4FyJy->
.
|
I see. Glad to know the project is still alive at least. I'll read through all the related issues. It definitely would be nice to have a solution of some sort. |
So, yet another 9 months have passed. Is there any progress here? |
Seeing as there are no updates on this issue, I can suggest using Trompeloeil mocking framework. It supports modern function specifiers like override and noexcept out of the box. |
Clang can emit a `-Winconsistent-missing-override` warning for most uses of the Google Mock `MOCK_METHOD` family of macros. See also google/googletest#533. Review: https://reviews.apache.org/r/67953/
Still hoping to see override implemented in some form. Even as additional macros to maintain backwards compatibility. This feature is so crazily useful, as it's such a common and confusing problem when an interface changes (even slightly, such as const), and then the behaviour of the test shifts in an unpredictable/confusing manner. |
I hacked "override" into all the MOCK_METHOD* macros in my local copy of gtest. The I had to define MOCK_METHOD[123]NOV without the "override" when I wanted to mock a method which was not in the base class. |
I have been cleaning up older and inactive GitHub googletest issues. You may see an issue "closed" if it appears to be inactive/abandoned |
We have been slowly adding "override" as googletest requires C++11. At the same time this is not a priority . |
While finding good solution seems hard to make everyone happy, would just using: _Pragma("clang diagnostic push") be good enough? |
@kwesolowski good solution is running clang-modernize and extracting "override" output |
It's a bit difficult to run clang-modernize on pump input |
@gennadiycivil this can be used actual violations in gtest code, but override cannot fix MOCK_METHOD macros because they BY DESIGN allow all of: And for user of GMOCK those macros are main painpoint, becouse other missing overrides are easy to avoid by -isystem. |
The scope of this issue is "Use override keyword with new C++11 compilers". This has been opened since 2015 for what looks to me as internal housekeeping. ( Well before my time). Since then the discussion has been all over the place with regards to the actual scope without any actionable PRs. I am closing it for clarity. If there is an actual actionable issue , preferably with a PR to look at , it will be welcomed. |
…google#1821 * following the model of MOCK_CONST_METHOD, added MOCK_NOEXCEPT_METHOD * also added the MOCK_VIRTUAL_METHOD, which adds the override keyword * added all combination of CONST / NOEXCEPT / VIRTUAL where it made sense.
From @GoogleCodeExporter on August 24, 2015 22:40
Original issue reported on code.google.com by
piot...@gmail.com
on 15 Dec 2012 at 9:23Attachments:
Copied from original issue: google/googlemock#157
The text was updated successfully, but these errors were encountered: