diff --git a/NEWS.md b/NEWS.md index edb3481f..ce7f3d90 100644 --- a/NEWS.md +++ b/NEWS.md @@ -148,6 +148,7 @@ Red Panda C++ Version 2.27 - fix: Name of the macro for project private resource header is not correct. - fix: In sdcc project, sdcc keywords are not in completion suggest list. - fix: In sdcc project, parser are not correctly inited as sdcc parser. + - fix: Temp object + member function call is wrongly parsed as constructor. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index e05d7b1b..d305f884 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2332,6 +2332,13 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType, int maxIndex) //Won't implement: ignore function decl like int (text)(int x) { }; return; } + //it's a chain function call + if (mTokenizer[indexAfter]->text == "." + || mTokenizer[indexAfter]->text == "->" + || mTokenizer[indexAfter]->text == "::" ) { + mIndex = indexOfNextPeriodOrSemicolon(indexAfter, maxIndex); + return; + } //it's not a function define if (mTokenizer[indexAfter]->text == ',') { // var decl with init