In C++11 non static member functions now support reference qualifiers. For the un-initiated they go after the function declaration/definition and can be combined with const and/or volatile. Just like the const and volatile qualifiers they allow overloading the function on the type of the implicit object parameter ("this"). struct foo { foo(); void bar() & ; //1. Lvalue reference qualifier void bar() &&; //2. Rvalue reference qualifier }; void myfunc() { foo f; f.bar(); //Calls 1 since the implicit object parameter is an lvalue foo().bar(); //Calls 2 since the implicit object parameter is an rvalue } 1 and 2 are treated as syntax errors by KDevelop and as an obvious side effect completion for those functions is not available either. Reproducible: Always Steps to Reproduce: 1. Enter the example provided into a C++ file 2. Compile as C++11 (currently clang 3.1 is the only compiler i have that understands this) Actual Results: KDevelop flags a syntax error even though it is valid C++11 and successfully compiles. Expected Results: KDevelop should accept the syntax and understand it for the purpose of completion although simply accepting it as valid syntax but acting as if the reference qualifiers are not present would be a great start since then completion could presumably work even if filtering out completions by context wouldn't.
Git commit 4f7dc5113be5967d84cad1fcd5effc7e65c8a824 by Milian Wolff. Committed on 08/01/2013 at 01:07. Pushed by mwolff into branch 'master'. Properly parse C++11 reference bindings. These are ignored in the semantic analysis for now but at least this way code completion does not break and no annoying errors are shown. M +2 -0 languages/cpp/parser/ast.h M +13 -1 languages/cpp/parser/parser.cpp M +1 -0 languages/cpp/parser/parser.h M +1 -0 languages/cpp/parser/tests/test_parser.h M +11 -0 languages/cpp/parser/tests/test_parser_cpp2011.cpp http://commits.kde.org/kdevelop/4f7dc5113be5967d84cad1fcd5effc7e65c8a824
Yay, thank you. Building from master once I get home...