Version: 3.0 CVS (8/23/03) (using KDE Devel) Installed from: Compiled sources Compiler: i686-pc-linux-gnu-gcc (GCC) 3.3.2 20030812 (Debian prerelease) OS: Linux When the cppparser runs into a compound literal in a function/method, it hiccups and causes other function-scope variables and function calls to appear as global symbols in the class browser: void foo( float[2] ); void compoundLiteralTest() { foo( (float[]){ 0.0f, 1.0f } ); int anotherVar; // appears as global scope in the class browser ... } This construct parsed fine until these lines were added to Parse::skip() in lib/cppparser/parser.cpp (rev 1.3): else if( l != '{' && (tk == '{' || tk == '}' || tk == ';') ) return false; which causes Parse::skip( '(', ')' ) to error out while skipping through "( (float[]){ 0.0f, 1.0f } )" While compound literals aren't legal in ANSI C++, they are in C99 and GNU C++ extensions...
confirmed with CVS from 20041026
Currently the parser of kdevelop from SVN does not accept this code at all, but as of gcc it is valid code and compiles fine. Of couse, we can not check if it still produces a global symbol until the parser accepts this correct code again.
This is basically the same thing as 57156, the parser from kdevelop simply isn't build for C. *** This bug has been marked as a duplicate of 57156 ***
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively