[PATCHJ] Fix for diagnosing half pointers/arrays

John McCall rjmccall at apple.com
Fri Feb 8 14:23:09 PST 2013


On Feb 8, 2013, at 8:32 AM, Joey Gouly <joey.gouly at arm.com> wrote:
> In r173254 I committed some changes to add support for 'half' type to clang.
> 
> I got some of the error cases wrong, and produced a diagnostic for '&h[0]'
> and '&*h',
> which are both defined to always produce a pointer. C99 6.5.3.2, footnote
> 84.
> 
> Does this look like a good fix?

You don't actually care about *why* you have an lvalue of half type;  you just
care that you *do*, and that you're trying to do an lvalue-to-rvalue conversion
on it.  Just check whether the lvalue expression's type isHalfType() instead
of trying to enumerate all the syntactic cases that can give rise to it.

John.



More information about the cfe-commits mailing list