User forums > Help
Code-Completion sometimes can't deal with const in the right side.
blueshake:
I got the reason why the right const don't work.
here is the reason:
for these codes,
--- Code: ---ClassB const & b_1,
--- End code ---
when the parser meet const ,it clear the m_Str;
see codes in void ParserThread::DoParse() in parserthread.cpp
--- Code: ---else if (token==ParserConsts::kw_const)
{
m_Str.Clear();
}
--- End code ---
as we known, m_Str stored the variable type,and if const is in
the right position and the parser clear the m_Str,the varible type will become
nothing ,that's why cc don't work.
I think the parser should do nothing when it meet const.
here is the patch.
--- Code: ---Index: plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- plugins/codecompletion/parser/parserthread.cpp (revision 5784)
+++ plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -455,7 +455,7 @@
}
else if (token==ParserConsts::kw_const)
{
- m_Str.Clear();
+ //m_Str.Clear();
}
else if (token==ParserConsts::kw_extern)
{
--- End code ---
ollydbg:
--- Quote ---I think the parser should do nothing when it meet const.
--- End quote ---
Hi, You just comment out the related code, so the parser will skip all the "const".
Can we find a more convenient way?
I personally think skipping "const" is not a good manner.
Navigation
[0] Message Index
[*] Previous page
Go to full version