This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Don't add -Wnon-virtual-dtor if affected by GCC PR102168
ClosedPublic

Authored by MaskRay on Sep 7 2021, 5:04 PM.

Details

Summary

See the discussion on
https://reviews.llvm.org/rG4852c770fe8703145dd2a35395985646ce57a454
The GCC behavior (https://gcc.gnu.org/PR102168)
seems less useful.

Unconditional -Wnon-virtual-dtor led to other unnecessary workarounds like
6df09d6ccbc0cb72d3278cafb592e9bc0e6b84a1

This patches uses a variant of 4bb5f44c701402462cb93ef00d46d52382f39f11 check to detect GCC PR102168

Diff Detail

Event Timeline

MaskRay created this revision.Sep 7 2021, 5:04 PM
MaskRay requested review of this revision.Sep 7 2021, 5:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2021, 5:04 PM

Checked that clang++ build has -Wnon-virtual-dtor and g++ build don't have the option.

MaskRay edited the summary of this revision. (Show Details)Sep 7 2021, 5:06 PM
dblaikie accepted this revision.Sep 7 2021, 11:30 PM

Looks about right to me, thanks!

This revision is now accepted and ready to land.Sep 7 2021, 11:30 PM

I don't think the derived class is necessary for the test case, though - could remove that.

MaskRay updated this revision to Diff 371258.Sep 7 2021, 11:35 PM

remove derived

This revision was landed with ongoing or failed builds.Sep 7 2021, 11:37 PM
This revision was automatically updated to reflect the committed changes.