summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-02-19 00:13:59 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-02-19 00:13:59 +0000
commit9c9127eacea4d58bf328de90d7da3245a552b9c4 (patch)
treeecfb4845d782535e7b16b00a289f97b4fe691018 /clang/lib
parentfc1ad1f3713e65b5c2773341d31a3ae12f9258a7 (diff)
downloadbcm5719-llvm-9c9127eacea4d58bf328de90d7da3245a552b9c4.tar.gz
bcm5719-llvm-9c9127eacea4d58bf328de90d7da3245a552b9c4.zip
Fix a missed case in the NULL operand to conditional operator
diagnostics. Patch by Stephen Hines. llvm-svn: 125998
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index b78e52303e1..9113f8a4621 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3141,6 +3141,10 @@ QualType Sema::CXXCheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS,
if (!Composite.isNull())
return Composite;
+ // Check if we are using a null with a non-pointer type.
+ if (DiagnoseConditionalForNull(LHS, RHS, QuestionLoc))
+ return QualType();
+
Diag(QuestionLoc, diag::err_typecheck_cond_incompatible_operands)
<< LHS->getType() << RHS->getType()
<< LHS->getSourceRange() << RHS->getSourceRange();
OpenPOWER on IntegriCloud