Implemented CastExpression. ImplicitCast and ExplicitCast statement classes.
Fixed implicit constructor string generation.
Implemented CtorExpr.
All test cases pass.
Fixed indentations, streamlined the code.
Fixed regressions.
Fixed regressions.
Adding a test case not covered before.
Fixed, refactored and simplified things.
Still more fixes (0 to null ptr conversion, enum check). The additional test passes now too.
This works around the following parse issue which would trigger an subsequent assert when handling source locations:
RecordDecl 0x848e5c00 <<invalid sloc>> <invalid sloc> implicit struct __va_list definition
`-FieldDecl 0x848e5c60 <<invalid sloc>> <invalid sloc> __ap 'void *'
As enum PrimitiveType is supposed to represent C++ types, having Int32
and UInt32 there is not correct.
This patch renames those values to Int and UInt.
This doesn't change the behavior, but makes it clearer that the types
for 'int' and 'unsigned int' are not necessarily 32 bits.
As enum PrimitiveType is supposed to represent C++ types, having Int64
and UInt64 there is not correct.
This patch renames those values to LongLong and ULongLong.
This doesn't change the behavior, but makes it clearer that the types
for 'long long' and 'unsigned long long' are not necessarily 64 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
As enum PrimitiveType is supposed to represent C++ types, having Int16
and UInt16 there is not correct.
This patch renames those values to Short and UShort.
This doesn't change the behavior, but makes it clearer that the types
for 'short' and 'unsigned short' are not necessarily 16 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
As enum PrimitiveType is supposed to represent C++ types, having Int8
and UInt8 there is not correct.
This patch removes those values. As Int8 and UInt8 were set to be
equivalent to Char and UChar, we can just change all references to Int8
and UInt8 to Char and UChar.
This doesn't change the behavior, but makes it clearer that the types
for 'char' and 'unsigned char' are not necessarily 8 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
The enum PrimitiveType represents, according to the comment, "the C++
built-in types.". However, it does not contain values for C++'s "long"
or "unsigned long", and the parser converts long to int. This is not
correct, and is a problem with 64bit support.
This patch adds Long and ULong values to PrimitiveType, and adds those
to all the switch-cases all around the code. For now Long and ULong are
handled exactly like Int and UInt, so this patch does not change
behavior.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Fix the following warning by renaming ParserResult::Parser to
CodeParser.
In file included from ../../../src/CppParser/Parser.h:16:0,
from ../../../src/CppParser/Comments.cpp:8:
../../../src/CppParser/CppParser.h:86:13: warning: declaration of ‘CppSharp::CppParser::Parser* CppSharp::CppParser::ParserResult::Parser’ [-fpermissive]
Parser* Parser;
^
../../../src/CppParser/CppParser.h:73:8: warning: changes meaning of ‘Parser’ from ‘struct CppSharp::CppParser::Parser’ [-fpermissive]
struct Parser;
^
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>