Type cast in clang

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Type cast in clang

Pisit Makpaisit
Are there easy way to cast type from IntegerLiteral to FloatingLiteral and vice versa? How?

Thanks in advance
--
Remixman (Pisit Makpaisit)

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Type cast in clang

John McCall
On Jan 11, 2011, at 9:30 PM, Pisit Makpaisit wrote:
> Are there easy way to cast type from IntegerLiteral to FloatingLiteral and vice versa? How?

I'm not sure what you mean.  An IntegerLiteral is never a FloatingLiteral.  You can make an implicit conversion node which does a CK_IntegralToFloating conversion, and then you'll have a constant expression of floating-point type;  but it still won't actually be a FloatingLiteral.

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev