Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Anonymous object content assist fails

There are 2 problems we have with this code.  The first is that Square()
looks like a function call, and the parser is only looking for functions in
the symbol table, constructors are handled seperately from functions so are
not even considered in this case.
The second problem is that we don't actually define a default constructor
with no parameters (we define the copy constructor, but for some reason we
forgot this other one).

In the head, check out
org.eclipse.cdt.internal.core.parser.Parser#postfixExpression for the
handling of the function call.
Check out
 to see how the default copy constructor was done.


cdt-dev-admin@xxxxxxxxxxx wrote on 12/15/2004 07:35:51 AM:

> I have created a class named Square and trying to access its functions,
> creating an anonymous object. But the content assist facility is not
> invoked. Is content assist of CDT not supported for anonymous objects.
> For example
>   class Square
>   {
>      int side;
>      public :
>        void setSide(int pSide)
>        {
>           side = pSide;
>        }
>        int area()
>        {
>          return side * side;
>        }
>   }
>   int main()
>   {
>     Square(). //Content assist is not getting invoked here either
> automatically or pressing CTRL + SPACE. Both fail
>     Square mySquare;
>     mySquare. //Content assist successfully works here
>   }
>   What's the issue. If I need to add this facility where to poke around.
> This email (including any attachments) is intended for the sole use of
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> distribution or forwarding of any or all of the contents in this message
> STRICTLY PROHIBITED. If you are not the intended recipient, please
> the sender by email and delete all copies; your cooperation in this
> is appreciated.
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top