From: LLVM Packaging Team Date: Tue, 25 Apr 2017 13:10:10 +0000 (+0000) Subject: allow-opencl-pointer-to-bool X-Git-Tag: archive/raspbian/1%3.9.1-9+rpi1^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7a71b32e5493b7b93681489f2a21fe6bb0c235f7;p=llvm-toolchain-3.9.git 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 --- diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 719e1e35..58aab003 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()); }