Closed balazske closed 4 years ago
This problem happens because there are import errors during ASTNodeImporter::ImportOverrides
. The source of the error (name conflict) must be investigated but in general it can be problem if we get error there:
struct A {
virtual void f();
};
struct B : public A {
void f() override;
};
struct C : public B {
void f() override;
};
In this case the overridden method for C::f
is B::f
and CXXRecordDecl::isVirtual
should be true for B::f
when addOverriddenMethod
is called. If import of A::f
failed but not B::f
and C::f
the overridden method for B::f is not set so it is "not virtual" (isVirtual is false).
Could we set the error for all overrides (B::f, C::f) in case we have an error in the overridden (A::f)?
It looks like that #564 (https://reviews.llvm.org/D62131) makes the NameConflict errors (and the assertion) disappear. Still the ImportOverrides
can be made to return Error
.
FYI, https://reviews.llvm.org/D62131 is not merged to master yet. So, perhaps there is something else
Assertion during analysis of bitcoin with clang master commit 3c10f346dcd and applied patch in D65577 and D65935 and D65999.