mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
Fix regression from r184810.
Specifically, CallExpr::getCalleeDecl() can return null, so make sure to handle that correctly. llvm-svn: 184813
This commit is contained in:
@@ -895,8 +895,10 @@ CanThrowResult Sema::canThrow(const Expr *E) {
|
||||
CT = CT_Dependent;
|
||||
else if (isa<CXXPseudoDestructorExpr>(CE->getCallee()->IgnoreParens()))
|
||||
CT = CT_Cannot;
|
||||
else
|
||||
else if (CE->getCalleeDecl())
|
||||
CT = canCalleeThrow(*this, E, CE->getCalleeDecl());
|
||||
else
|
||||
CT = CT_Can;
|
||||
if (CT == CT_Can)
|
||||
return CT;
|
||||
return mergeCanThrow(CT, canSubExprsThrow(*this, E));
|
||||
|
||||
@@ -39,6 +39,9 @@ void (*pallspec)() throw(...);
|
||||
void (*pintspec)() throw(int);
|
||||
void (*pemptyspec)() throw();
|
||||
|
||||
typedef void (*funcptr)();
|
||||
funcptr returnsptr() throw();
|
||||
|
||||
void callptr() {
|
||||
N(pnospec());
|
||||
N((*pnospec)());
|
||||
@@ -48,6 +51,7 @@ void callptr() {
|
||||
N((*pintspec)());
|
||||
P(pemptyspec());
|
||||
P((*pemptyspec)());
|
||||
N(returnsptr()());
|
||||
}
|
||||
|
||||
struct S1 {
|
||||
|
||||
Reference in New Issue
Block a user