Author Topic: small bug of code complete(friend operator)  (Read 3747 times)

Offline snija

  • Multiple posting newcomer
  • *
  • Posts: 20
small bug of code complete(friend operator)
« on: September 19, 2006, 01:09:24 pm »
I`ve found a small bug about code completion.
Code completion fails when you define a friend operator in the class.
Code
#include <iostream>
/* class A*/
class clsA
{
    int m_iclsA;
};

/* class B*/
class clsB
{
    int m_iclsB;
    public:
    clsB(int x=0){m_iclsB=x;}
    ~clsB(){;}
    void value(){std::cout << "The value is "<< m_iclsB << std::endl;}
    friend clsB operator + (const clsB & para0,const clsB & para1){
        clsB temp;
        temp = para0.m_iclsB + para1.m_iclsB;
        return temp;
    }
};

/* class C*/
class clsC
{
    int m_iclsC;
};
/**/

int main()
{
    clsB obB0(0),obB1(1),obB2(2);
    obB0.value();
    obB0 = obB1 + obB2;
    obB0.value();
    std::cout << "Ends" << std::endl;
    return 0;
}
It could be successfully compiled and run,but clsC does not exist in the symbols.
Also, when you type obB0. and no code completion exists.
After you remove that friend operator definition, everything`s ok.
Please fix this bug,thanks a lot.
Win XP SP2, cb nightly build (several versions up to sep-18).