Skip to content

Commit

Permalink
[SCEV] Fix GCC -Wnon-virtual-dtor
Browse files Browse the repository at this point in the history
SCEVPredicate has a friend declaration. The friend can technically call the
protected destructor, so the warning is legitimate. Clang simply doesn't implement
the friend check.

Make the dtor virtual to fix the issue.
  • Loading branch information
MaskRay committed Sep 1, 2021
1 parent 85fd44d commit 4852c77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/include/llvm/Analysis/ScalarEvolution.h
Expand Up @@ -209,7 +209,8 @@ class SCEVPredicate : public FoldingSetNode {

protected:
SCEVPredicateKind Kind;
~SCEVPredicate() = default;
// Use virtual to suppress -Wnon-virtual-dtor in the presence of friend.
virtual ~SCEVPredicate() = default;
SCEVPredicate(const SCEVPredicate &) = default;
SCEVPredicate &operator=(const SCEVPredicate &) = default;

Expand Down

0 comments on commit 4852c77

Please sign in to comment.