Version: 4.0.90 (using KDE 4.4.6)
In variable declaration c++ parser fails to recognize 'register' as a keyword and considers it an identifier.
Steps to Reproduce:
int register test;
in legal part of a code.
I cannot even compile this with gcc, can you give a fully compiling example please?
Sorry about the misinformation, the correct syntax is, of course
register int i;
(compilable with g++ 4.6)
However, the bug is no longer present in 4.2.2, thanks for the fix.
Created attachment 61647 [details]
Seems like both examples of syntax are accepted by g++, attaching the testcase for the former example (tested with g++ 4.2 -- 4.6) However, the KDevelop stil doesn't recognize the "int register varname;" syntax.
Sorry about the confusion, the bug is still present in 4.2.2, as it doesn't accept the syntax accepted by g++
Git commit 4e7bf7a7c910d3cbf9e34cec7df1a642e2ac7f55 by Milian Wolff.
Committed on 08/07/2011 at 15:51.
Pushed by mwolff into branch 'master'.
support arbitrary order of type-specifier and storage-class-specifier
TODO: we really need to adhere to the spec better by adding a
parserDeclSpecifier which should solve this problem and others
M +5 -0 languages/cpp/parser/parser.cpp
M +9 -0 languages/cpp/parser/tests/test_parser.cpp
M +2 -0 languages/cpp/parser/tests/test_parser.h