IsVirtual for destructors

Hello,

I’ve read the source code of the CXXMethodDecl::isVirtual function https://clang.llvm.org/doxygen/DeclCXX_8h_source.html#l01877

bool isVirtual() const {

CXXMethodDecl *CD =

cast(const_cast<CXXMethodDecl*>(this)->getCanonicalDecl());

// Member function is virtual if it is marked explicitly so, or if it is

// declared in __interface – then it is automatically pure virtual.

if (CD->isVirtualAsWritten() || CD->isPure())

return true;

return (CD->begin_overridden_methods() != CD->end_overridden_methods());

}

In code such as the following:

struct Base

{

virtual ~Base();

};

struct Derived :Base

{

~Derived();

};

The derived class destructor is virtual, but it is not virtual as written, not pure, and it appears that the list of overridden methods is empty. So the isVirtual function returns false.

Shall I fill a bug report?

Oops, sorry, I posted too fast, my test case had another issue. Please ignore my previous message.