From 6853a52074b64dffabd6358d6e2f20d0921c8881 Mon Sep 17 00:00:00 2001 From: LLVM Packaging Team Date: Sun, 18 Jun 2017 18:12:15 +0100 Subject: [PATCH] allow-opencl-pointer-to-bool Used by e.g. Blender on mesa-opencl-icd Author: Anastasia Stulova Origin: upstream https://reviews.llvm.org/rL294313 Bug: https://bugs.llvm.org/show_bug.cgi?id=30217 Bug-Debian: https://bugs.debian.org/857623 Gbp-Pq: Name 857623-allow-opencl-pointer-to-bool.diff --- clang/lib/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 719e1e350..58aab003b 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11424,7 +11424,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc, Context.getLangOpts().OpenCLVersion < 120) { // OpenCL v1.1 6.3.h: The logical operator not (!) does not // operate on scalar float types. - if (!resultType->isIntegerType()) + if (!resultType->isIntegerType() && !resultType->isPointerType()) return ExprError(Diag(OpLoc, diag::err_typecheck_unary_expr) << resultType << Input.get()->getSourceRange()); } -- 2.30.2