forked from OSchip/llvm-project
[analyzer] Fix an assertion fail in VirtualCallChecker
Differential Revision: https://reviews.llvm.org/D37978 llvm-svn: 313866
This commit is contained in:
parent
1390af2dd2
commit
5536a01ad2
|
@ -146,7 +146,7 @@ static bool isVirtualCall(const CallExpr *CE) {
|
|||
if (CME->getQualifier())
|
||||
CallIsNonVirtual = true;
|
||||
|
||||
if (const Expr *Base = CME->getBase()->IgnoreImpCasts()) {
|
||||
if (const Expr *Base = CME->getBase()) {
|
||||
// The most derived class is marked final.
|
||||
if (Base->getBestDynamicClassType()->hasAttr<FinalAttr>())
|
||||
CallIsNonVirtual = true;
|
||||
|
|
|
@ -271,3 +271,24 @@ int main() {
|
|||
#if !PUREONLY
|
||||
//expected-note-re@-2 2{{{{^}}Calling '~E'}}
|
||||
#endif
|
||||
|
||||
namespace PR34451 {
|
||||
struct a {
|
||||
void b() {
|
||||
a c[1];
|
||||
c->b();
|
||||
}
|
||||
};
|
||||
|
||||
class e {
|
||||
public:
|
||||
void b() const;
|
||||
};
|
||||
|
||||
class c {
|
||||
void m_fn2() const;
|
||||
e d[];
|
||||
};
|
||||
|
||||
void c::m_fn2() const { d->b(); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue