|
@@ -8086,6 +8086,13 @@ Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &CallerRHS,
|
|
|
return Compatible;
|
|
|
}
|
|
|
|
|
|
+ // OpenCL queue_t type assignment.
|
|
|
+ if (LHSType->isQueueT() && RHS.get()->isNullPointerConstant(
|
|
|
+ Context, Expr::NPC_ValueDependentIsNull)) {
|
|
|
+ RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
|
|
|
+ return Compatible;
|
|
|
+ }
|
|
|
+
|
|
|
// This check seems unnatural, however it is necessary to ensure the proper
|
|
|
// conversion of functions/arrays. If the conversion were done for all
|
|
|
// DeclExpr's (created by ActOnIdExpression), it would mess up the unary
|
|
@@ -10423,6 +10430,10 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS,
|
|
|
}
|
|
|
|
|
|
if (getLangOpts().OpenCLVersion >= 200) {
|
|
|
+ if (LHSType->isQueueT() && RHSType->isQueueT()) {
|
|
|
+ return computeResultTy();
|
|
|
+ }
|
|
|
+
|
|
|
if (LHSIsNull && RHSType->isQueueT()) {
|
|
|
LHS = ImpCastExprToType(LHS.get(), RHSType, CK_NullToPointer);
|
|
|
return computeResultTy();
|