Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] IType question



On Thu, Sep 13, 2012 at 7:06 AM, Raymond Qiu <zqiu@xxxxxxx> wrote:

Hey guys,

 

I have a method defined like below:
void myMethod( const Object* const myobj);


The second const in " const Object* const myobj" does not affect the function signature and is ignored according to C++ rules.



In CDT, the type of the parameter was resolved as a CPPPointerType which contains a type of CPPQualiferType which contains a type of PDOMCPPClassType. This looked correct. However, the isConst of the CPPointerType was false. From my understanding, in this case the it should be true since I defined a constant pointer points to a constant Object. The isConst of the CPPQualiferType was true which was correct. I also tested if my method was defined like below:
void myMethod( const Object* myobj);
The type of the parameter was resolved as the same as above. So, basically, it did not tell if a pointer is a const pointer. Is this expected?

Also, I have method defined like below:
void myMethod2( const Object);


Again, const does not affect function signature. 


the type of the parameter was resolved as a PDOMCPPClassType. So that I can not tell if the parameter is a const or not. Is this expected?

Thanks.

 

Raymond


-sergey 

 

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top