summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-08-26 05:13:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-08-26 05:13:19 +0000
commitd39bcaed2122c23a44dad3dc94b9e2166f8a3035 (patch)
tree385c89e8bc4b11404d45f6a2d694621fbf2a673b /clang/lib/Sema/SemaExpr.cpp
parentfae69e6d4be07b45117d0bbb0374bbe3ba4d9c45 (diff)
downloadbcm5719-llvm-d39bcaed2122c23a44dad3dc94b9e2166f8a3035.tar.gz
bcm5719-llvm-d39bcaed2122c23a44dad3dc94b9e2166f8a3035.zip
[Sema] Don't assume CallExpr::getDirectCallee will succeed
We tried to provide a very nice diagnostic when diagnosing an assignment to a const int & produced by a function call. However, we cannot always determine what function was called. This fixes PR24568. llvm-svn: 246014
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index f2c0fb82eef..5297d7e26a4 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -9316,7 +9316,7 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E,
if (const CallExpr *CE = dyn_cast<CallExpr>(E)) {
// Function calls
const FunctionDecl *FD = CE->getDirectCallee();
- if (!IsTypeModifiable(FD->getReturnType(), IsDereference)) {
+ if (FD && !IsTypeModifiable(FD->getReturnType(), IsDereference)) {
if (!DiagnosticEmitted) {
S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange
<< ConstFunction << FD;
OpenPOWER on IntegriCloud