I just wanted to know if someone knew about this issue or had some thoughts about it already. I am adding some more description to the problem
I was able to see there is an extra IntegerLiteral node added in the AST dump (truncated version shown below)
(InitListExpr 0xbaa7888 <col:40, col:52> 'int [3]'
(IntegerLiteral 0xbaa7680 <col:52> 'int' 4)
(IntegerLiteral 0xbaa7680 <col:52> 'int' 4)
(IntegerLiteral 0xbaa7730 <col:55> 'int' 5))) <============= extra init node
There is a call to InitListExpr::updateInit with Init subscript as "2" that connects these 2 nodes in the above hierarchy. The call that was leading to this was CheckArrayType(...); done almost at the end of CheckDesignatedInitializer. If I comment out this CheckArrayType call (just for testing) that additional IntegerLiteral 0xbaa7730 node is not created, but other side effects will be added as expected. Any comments based on above data?
Regards
Senthil Kumar
Sender : Eli Friedman<eli.friedman@gmail.com>
Title : Re: [cfe-dev] GNU extensions to C99 designated initializers gnu99-init-1.c test case
astdump1.txt (2.18 KB)