allow-opencl-pointer-to-bool
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 15 Apr 2017 10:03:30 +0000 (10:03 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 15 Apr 2017 10:03:30 +0000 (10:03 +0000)
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

index 719e1e3502cad4b50e09f5101af0c924f48189be..58aab003b00e51f788a59f498945d14ffc6e2a1c 100644 (file)
@@ -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());
       }