diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-19 00:13:59 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-19 00:13:59 +0000 |
commit | 7ef932429ed0edcc5e4bf44e516f5f4be6a8a03f (patch) | |
tree | 0b40685b3a7d43fb4cf686bc3d8f59a2a1fd2279 /lib/Sema/SemaExprCXX.cpp | |
parent | 0a8709a4744f6a80a006edf78b27597d9232ee30 (diff) |
Fix a missed case in the NULL operand to conditional operator
diagnostics.
Patch by Stephen Hines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index b78e52303e..9113f8a462 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/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(); |