Created attachment 70193 [details] Example: code completion not working for std::string variable After updating gcc suite to 4.7.0, code completion is not working anymore for some STL classes. It seems that the new "noexcept" keyword from c++11 is to be blamed.
Fixed, patch present. https://git.reviewboard.kde.org/r/104498
Created attachment 70199 [details] Example 2 - after Ivan patch - still no code completion for std::string
Thanks for quick action! :-) Unfortunately code completion still not working, maybe there is some other c++11 thingy causing the parser to fail. For a quick test (to check if the c++ includes coming with gcc 4.7.0 are indeed creating parsing issues) I replaced /usr/include/c++/4.7.0 with 4.6.3 files -- everything worked great again. By the way, after your patch Ivan, I observed that all the completion suggestions that should have opened on foo. (in my example) are opening outside of foo., in global scope (check the attached images 2 and 3).
Created attachment 70200 [details] Example 3 - code completion error: members are shown in global scope
Another problem seems to be related to "#if __cplusplus" statement in file c++config.h ("/usr/include/c++/4.7.0/{your_architecture}/bits/c++config.h"). I will try to dig into preprocessor implementation and fix it, but a quick&dirty fix could be replacing #if with #ifdef (I've made this replacement somewhat earlier for another reasons). After replacement (and clearing your DUChain cache), everything should work properly.
Thank you! That was it :-) I confirm it is working again. I wish I could share a couple of beers with you.
(In reply to comment #6) > Thank you! That was it :-) I confirm it is working again. > I wish I could share a couple of beers with you. The patch is updated again, now fixing that preprocessor bug. Please, test it with original c++config.h file.
Git commit c33000b0280bb329beb46266a4c69235ae38865a by Milian Wolff. Committed on 07/04/2012 at 14:14. Pushed by mwolff into branch '4.3'. c++11 support: handle noexcept-specification and noexcept-expression in our parser This is particularly useful with new GCC toolchain version 4.7.0, where these keywords are frequently used throughout STL. thanks to Ivan Shapovalov for the patch, I just cleaned it up a bit and added a unit test REVIEW: 104498 M +6 -0 languages/cpp/parser/ast.h M +22 -5 languages/cpp/parser/codegenerator.cpp M +1 -0 languages/cpp/parser/default_visitor.cpp M +1 -0 languages/cpp/parser/lexer.cpp M +68 -17 languages/cpp/parser/parser.cpp M +1 -0 languages/cpp/parser/tests/test_parser.h M +11 -1 languages/cpp/parser/tests/test_parser_cpp2011.cpp M +2 -0 languages/cpp/parser/tokens.cpp M +1 -0 languages/cpp/parser/tokens.h http://commits.kde.org/kdevelop/c33000b0280bb329beb46266a4c69235ae38865a
Git commit ab14ac7ce58968d857709572237035ec877e7988 by Milian Wolff. Committed on 07/04/2012 at 14:57. Pushed by mwolff into branch '4.3'. properly handle l, lu, ul integers in our preprocessor this finally fixes parsing of gcc 4.7 headers thanks again to Ivan Shapovalov for this patch, which I cleaned up a bit and added a unit test the question now: how should ll, ull, llu integers be handled by a c++11 compliant preprocessor? REVIEW: 104498 M +10 -2 languages/cpp/parser/rpp/pp-engine.cpp M +11 -1 languages/cpp/parser/tests/test_parser.cpp http://commits.kde.org/kdevelop/ab14ac7ce58968d857709572237035ec877e7988
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