-
Notifications
You must be signed in to change notification settings - Fork 136
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
fix unittest in gcc13 #40
Conversation
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.
Thank you for reporting the issue and proposing the fix! Please refer to the inline comments.
In addition, since this one should repro in GCC 13 while our pipeline is running the tests against GCC 11, we appreciate your help if you could help update the pipeline to use GCC 13 by default, or file an issue to track this if you are not familiar with GitHub Actions.
@microsoft-github-policy-service agree |
A new commit is appened to this MR to update the ci to gcc-13. plz review it :) |
I found that it seems clang is compatiable with #if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 13)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-move"
#endif
p = std::move(p);
#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 13)
#pragma GCC diagnostic pop
#endif But I am not sure if it will affect the portability. |
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.
LGTM
Should we merge the pragmas of clang and gcc or just keep them unchanged? @mingxwa |
@mingxwa Hi. Can it be merged? |
@coyorkdow Sorry for the delayed reply. Given that |
@mingxwa Got it. Does this PR is already to merge? Or any modification do I need to do? |
GCC13 added a new warning
Wself-move
(regarding info https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159). Therefore, the relevant codes in unittest will throw errors as-Werror
is opened.Add a diagnostic pragma to remove the errors.