]> granicus.if.org Git - clang/commitdiff
Fix regression from r184810.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 25 Jun 2013 01:55:41 +0000 (01:55 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 25 Jun 2013 01:55:41 +0000 (01:55 +0000)
Specifically, CallExpr::getCalleeDecl() can return null, so make sure to
handle that correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184813 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExceptionSpec.cpp
test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp

index 836385d031f8628e3c14650b74fafc58c8ea2820..0385c7783e33fda6d85717e9bcdc60bb34167fcb 100644 (file)
@@ -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));
index 33388cf3109ac59ef7cbace2f6b950396c569bb9..427e8c5007f2eeb51c4648205f0fa54cfab9ed8a 100644 (file)
@@ -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 {