News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Bug in CC (maybe)

Started by Max, December 21, 2010, 01:52:47 PM

Previous topic - Next topic

Max

Dear devs,

I'm reporting a bug in CC. It is present since the first nigthly related to the new CC interface but now I'm able to attach a short testcase.

I'm using 6900 (debugging branch) , Windows XP GCC MinGW 4.5.0.


Open the testcase archive and load the project. Open the file fooClass.cpp and put the cursor in line 7 (inside the constructor).

1) Write "m_foo". The completion suggestion related to the variable m_fooMemberData should appear. It doesn't!!

2) Now write "fooClass::m_foo"; this time you get the right completion suggestion.

Why I'm not getting the suggestion in the first case?


3) Delete line 4 and 46 of the file fooClass.h and line 3 of the file fooClass.cpp (all the lines related to the namespace foo) and save the files. Now the code completion suggestion works both using "m_foo" and "fooClass:m_foo".

So it should be related to the managment of the namespaces.

Becasue I'm always using a namespace the use of the CC is pretty ugly.

Hope this helps

Max

ollydbg

confirmed. we will check it.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

I have debugged a while, and found that for the code:


using namespace foo;

fooClass::fooClass()   //************ONE************
{

}


fooClass::~fooClass()
{

}


When we are here in the ONE place, we try to find the "fooClass" in the global namespace, so this was not correctly. at least we should try to consider the scope invoked by the using statement:

using namespace foo;

I think I have answered this kind of question several months ago.

But currently, it was quite complex to do this.

I suggest you can use this way:


namespace foo   // open the foo namespace
{

fooClass::fooClass()   //************ONE************
{

}


fooClass::~fooClass()
{

}

} close the namepsace

this should works.



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Max

I just tested one class and the proposed workaround worked. Becasue the using statement is a common coding style in implementation files it will be welcome to fix the CC in future. In the meantime, because I think CC deserve to be used, I'm going to update my projects...

Thx

Max