Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Disable the -Wself-move warning that triggers on exactly what …
…is being tested (NFC) /Users/jiefu/llvm-project/llvm/unittests/Option/OptionParsingTest.cpp:251:6: error: explicitly moving variable of type 'InputArgList' to itself [-Werror,-Wself-move] AL = std::move(AL); ~~ ^ ~~ 1 error generated.
- Loading branch information
4e627a3
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.
Thanks for this fix. I was just about to do the same thing. I introduced this problem with https://reviews.llvm.org/D158134.
I see that in a similar case (llvm/unittests/ADT/APIntTest.cpp) this is done before disabling Wself-move:
Is that needed?
4e627a3
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.
It passed on my local machine without ignoring "-Wunknown-pragmas".
You mean not all clang compilers would recognize
-Wself-move
?I'm not sure about it.
Let's see if the buildbots would complain about it.
Thanks.
4e627a3
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.
It looks like -Wself-move was added nine years ago. I doubt we'll see it causing problems.
4e627a3
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.
Okay.
I'll fix it once the error occurs.
Thanks.
Just wondering: can the llvm-project be built successfully with clang versions 9 years ago?
4e627a3
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.
Good question. No, it can't. I guess that makes this a closed issue.
4e627a3
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.
It might still be nicer to slightly obfuscate the code to avoid the warning, rather than having to do all the pragma shenanigans?