I have the patch to fix this issue:
Auto-completion of function pointers in a structure (https://developer.berlios.de/bugs/?func=detailbug&bug_id=18483&group_id=5358)
Index: parserthread.cpp
===================================================================
--- parserthread.cpp (revision 7785)
+++ parserthread.cpp (working copy)
@@ -1948,7 +1948,7 @@
m_Tokenizer.SetState(oldState);
}
-void ParserThread::HandleFunction(const wxString& name, bool isOperator)
+void ParserThread::HandleFunction(wxString& name, bool isOperator)
{
TRACE(_T("HandleFunction() : Adding function '")+name+_T("': m_Str='")+m_Str+_T("'"));
int lineNr = m_Tokenizer.GetLineNumber();
@@ -2029,6 +2029,25 @@
break; // function decl
else if (peek == ParserConsts::kw_const)
isConst = true;
+ else if (peek.GetChar(0)== ParserConsts::opbracket_chr)
+ {
+ //Here, we meet some kind of statement like: a function pointer declaration
+ //unsigned int (*func1)(int var1);
+ //now: peek = (int var1);
+ int pos = peek.find(ParserConsts::ptr);
+ if (pos != wxNOT_FOUND) //find *
+ {
+ peek.Trim(true).RemoveLast();
+ peek.Remove(0, pos+1);
+ name = peek;
+ peek = m_Tokenizer.PeekToken();
+ //Thus, the peek should be ";"
+ if( peek == ParserConsts::semicolon )
+ {
+ break; // function pointer declaration
+ }
+ }
+ }
else
break; // darned macros that do not end with a semicolon :/
Index: parserthread.h
===================================================================
--- parserthread.h (revision 7785)
+++ parserthread.h (working copy)
@@ -196,7 +196,7 @@
* @param name function name
* @param isOperator if true, means it is an operator overload function
*/
- void HandleFunction(const wxString& name, bool isOperator = false);
+ void HandleFunction(wxString& name, bool isOperator = false);
/** handle enum declaration */
void HandleEnum();
So, I need your comments. :)