[LLVMbugs] [Bug 9745] Struct initialization failure

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 18 11:05:17 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9745

Remy Demarest <remy.demarest at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #2 from Remy Demarest <remy.demarest at gmail.com> 2011-04-18 13:05:16 CDT ---
(In reply to comment #1)
> I think I fixed this particular bug a few weeks ago.  That said, TOT clang
> actually rejects this example:
> 
> Users/kremenek/Downloads/StructureInit.m:27:29: error: initializing 'CGFloat'
> (aka 'double') with an expression of incompatible type 'CGSize' (aka 'struct
> __CGSize')
>     CGRect rect = { origin, size };
>                             ^~~~
> /Users/kremenek/Downloads/StructureInit.m:35:41: error: initializing 'CGFloat'
> (aka 'double') with an expression of incompatible type 'CGSize' (aka 'struct
> __CGSize')
>     CGRect rect = { origin.x, origin.y, size };
>                                         ^~~~
> 2 errors generated.
> 
> When I change the CGRect definition in the test case to use CGSize (instead of
> CGPoint) for 'size', the test case analyzes cleanly.

Isn't that syntax supported by C, or at least C99 in either initializations or
compound statements?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list