Version: SVN (using KDE 4.4.5) OS: Linux In my project I'm using a struct type called AVRational: typedef struct AVRational{ int num; ///< numerator int den; ///< denominator } AVRational; And declare an AVRational: AVRational i; If I try to set this struct: i = (AVRational){1,10}; KDevelop editor doesn't parse this instruction. I think this syntax is correct in c/c++ because the program compiles fine. Reproducible: Didn't try Steps to Reproduce: Create a new C file with this contents: #include <stdio.h> typedef struct MyStruct { int num; int den; } MyType; int main() { MyType i; i = (MyType){1,13}; printf("%d and %d\n",i.num,i.den); return 1; } And compiles with: gcc teste.c -o teste -Wall Or: clang teste.c -o teste Or: tcc teste.c -o teste I've used just these three compilers and all them compile fine and don't show any warning messages.
This is actually called a "compound literal".
This doesn't work for me as well, as shown on the screenshot: http://rushbase.net/stuff/kdevelop_weird_problems.png
related: https://bugs.kde.org/show_bug.cgi?id=57156
It's not just related, it's a clear duplicate - both handle C99 compound literals. I have a fix for that, going to push it to reviewboard soon. *** This bug has been marked as a duplicate of bug 57156 ***