-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Minor fixes for libstdc++ 15 #178601
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
Minor fixes for libstdc++ 15 #178601
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
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.
Code Review
This pull request introduces several minor fixes for compatibility with libstdc++ 15. The changes primarily involve adding necessary headers like <cstdint> and <memory> to various files, ensuring they are self-contained. Additionally, the API for Filter::Open has been updated to use std::string instead of std::string_view for file paths, which is a valid approach to resolve issues with std::ifstream. My review includes suggestions to refine this API change by using a const reference for the string parameter, which is a standard practice to prevent unnecessary copies and aligns with the project's C++ style guide.
0887ce1 to
788e7b5
Compare
| #include <fstream> | ||
| #include "third_party/abseil-cpp/absl/strings/str_cat.h" | ||
|
|
||
| absl::StatusOr<Filter> Filter::Open(std::string_view path) { |
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 don't understand this change. Why not just a std::string_view reference (with an include of <string_view>`?
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.
std::ifstream::open() does not accept a std::string_view argument
libstdc++ only accepts std::string and not std::string_view as an argument
788e7b5 to
64d255b
Compare
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
This adds some includes and changes an API in an internal tool to use
std::stringinstead ofstd::string_viewfor a path, fixing builds with libstdc++ 15List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.