1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibCpp: Parse C++ cast expressions

parse static_cast, reinterpret_cast, dynamic_cast & const_cast
This commit is contained in:
Itamar 2021-03-31 22:21:31 +03:00 committed by Andreas Kling
parent 646aaa111b
commit 8962581c9c
4 changed files with 74 additions and 1 deletions

View file

@ -696,4 +696,20 @@ public:
NonnullRefPtrVector<Declaration> m_declarations;
};
class CppCastExpression : public Expression {
public:
CppCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
: Expression(parent, start, end, filename)
{
}
virtual ~CppCastExpression() override = default;
virtual const char* class_name() const override { return "CppCastExpression"; }
virtual void dump(size_t indent) const override;
StringView m_cast_type;
RefPtr<Type> m_type;
RefPtr<Expression> m_expression;
};
}