[llvm-bugs] [Bug 30217] New: Invalid diag "error: invalid argument type 'struct foo *' to unary expression"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 30 23:48:27 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30217

            Bug ID: 30217
           Summary: Invalid diag "error: invalid argument type 'struct foo
                    *' to unary expression"
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: funfunctor at folklore1984.net
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17192
  --> https://llvm.org/bugs/attachment.cgi?id=17192&action=edit
Reduced test case.

Hi,

While building the attached test case using the OpenCL frontend the canonical
form of checking pointer nullity is treated in a way that results in an invalid
diagnostic error raised.


FAILS:

```
if (!ptr)
  ...

```

PASSES:

```
if (ptr == NULL)
  ...

```

Compile with: $ clang -S -emit-llvm -o test.ll -x cl test.cl

Kind Regards,
Edward.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160831/2d621606/attachment.html>


More information about the llvm-bugs mailing list