[SCEV] Fix GCC -Wnon-virtual-dtor

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.
This commit is contained in:
Fangrui Song 2021-09-01 01:12:32 -07:00
parent 85fd44d7fe
commit 4852c770fe
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ public:
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;