This is an archive of the discontinued LLVM Phabricator instance.

Only ignore -Wdeprecated-copy if the used compiler supports the warning
ClosedPublic

Authored by uabelho on Apr 26 2021, 5:37 AM.

Details

Summary

This is needed after

https://reviews.llvm.org/rG9658d045926545e62cc3f963fe611d7c5d0c9d98

which introduced code that at least didn't compile clean with clang 8.

Diff Detail

Event Timeline

uabelho created this revision.Apr 26 2021, 5:37 AM
uabelho requested review of this revision.Apr 26 2021, 5:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2021, 5:37 AM
xbolva00 accepted this revision.Apr 26 2021, 5:42 AM
xbolva00 added a subscriber: xbolva00.

Thanks

This revision is now accepted and ready to land.Apr 26 2021, 5:42 AM
uabelho added a comment.EditedApr 26 2021, 5:46 AM

Thanks

Would you mind submitting it if you think it's correct? @xbolva00

Thanks

Would you mind submitting it if you think it's correct? @xbolva00

Ok

This revision was landed with ongoing or failed builds.Apr 26 2021, 7:01 AM
This revision was automatically updated to reflect the committed changes.
Conanap added a subscriber: Conanap.EditedApr 26 2021, 7:12 AM

Hello,

This patch seems to upset the PowerPC compilers:

In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/Support/YAMLIOTest.cpp:18:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/unittest/googlemock/include/gmock/gmock.h:58:40: error: missing binary operator before token "("
 #if defined(__clang__) && __has_warning("-Wdeprecated-copy")

Buildbot in question: https://lab.llvm.org/buildbot/#/builders/36/builds/7742

xbolva00 reopened this revision.Apr 26 2021, 7:16 AM

This has issue (error: missing binary operator before token "(") on GCC, I trusted and thought you checked it if it builds fine.

Try:

#if defined(__clang__) 
#if __has_warning("-Wdeprecated-copy")
#endif
#endif

I am not gonna spend my time on this deprecated-copy hell anymore. Public bots are ok, you use clang 8, so please try again & commit by yourself.

This revision is now accepted and ready to land.Apr 26 2021, 7:16 AM
This revision now requires review to proceed.Apr 26 2021, 7:17 AM
uabelho updated this revision to Diff 340537.Apr 26 2021, 8:41 AM

Use
#ifdef clang
#if has_warning("-Wdeprecated-copy")
instead of
#if defined(
clang) && has_warning("-Wdeprecated-copy")
as the latter seems to break gcc bots.

Use
#ifdef clang
#if has_warning("-Wdeprecated-copy")
instead of
#if defined(
clang) && has_warning("-Wdeprecated-copy")
as the latter seems to break gcc bots.

I have no idea if this is the best fix but it works for me with clang 8 and gcc 9.3.0.

If you don't want to review this fix of your patch https://reviews.llvm.org/rG9658d045926545e62cc3f963fe611d7c5d0c9d98 then please add someone who can.

Thanks.

xbolva00 added a comment.EditedApr 26 2021, 9:16 AM

Use
#ifdef clang
#if has_warning("-Wdeprecated-copy")
instead of
#if defined(
clang) && has_warning("-Wdeprecated-copy")
as the latter seems to break gcc bots.

I have no idea if this is the best fix but it works for me with clang 8 and gcc 9.3.0.

Best fix is remove all deprecated things but yeah, for now this is ok.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 26 2021, 11:32 PM
This revision was automatically updated to reflect the committed changes.

Use
#ifdef clang
#if has_warning("-Wdeprecated-copy")
instead of
#if defined(
clang) && has_warning("-Wdeprecated-copy")
as the latter seems to break gcc bots.

I have no idea if this is the best fix but it works for me with clang 8 and gcc 9.3.0.

Best fix is remove all deprecated things but yeah, for now this is ok.

Ok, pushed a new attempt to fix the problem in
https://reviews.llvm.org/rG33f04e485c7d95626e12aa522b09cc81109fc6ab