Dereferencing a C99 compound literal fails - by Martin Storsjö

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 808473 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 11/13/2013 12:31:06 PM
Access Restriction Public


When dereferencing a C99 compound literal, the C parser gets the precedence of the cast expression wrong compared to the dereference.
Sign in to post a comment.
Posted by Microsoft on 6/6/2014 at 9:53 AM
Thank you for using Visual Studio and for reporting this bug. We are happy to let you know that this issue has been fixed in Visual Studio 2013 Update 2. If you already have Visual Studio 2013, you can upgrade to Update 2 for free or you can install a trial version from:
Posted by Microsoft on 2/6/2014 at 8:00 AM
This issue will be fixed in the Spring Update of VS 2013. The fix is not present in the CTP of the Spring Update, but will be in the final update.

--Jim Springfield
Posted by Bartosz Brachaczek on 1/2/2014 at 7:42 PM
Another manifestation of this issue is the following C99 code failing to compile:

int idx = 1;
int val = (int[]){ 1, 2, 3 }[idx];

error C2143: syntax error : missing ';' before '['
error C2337: 'idx' : attribute not found
error C2059: syntax error : ';'
Posted by Microsoft on 11/13/2013 at 9:02 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 11/13/2013 at 12:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(