Fixed compiler warning about non-virtual destructor.

This commit is contained in:
ck
2009-08-28 14:19:24 +02:00
parent aba678604c
commit 39a9606385

View File

@@ -69,6 +69,7 @@ private:
enum OpType { UnaryOp, BinaryOp, TernaryOp }; enum OpType { UnaryOp, BinaryOp, TernaryOp };
Operator(const QString &code, const QString &repr) Operator(const QString &code, const QString &repr)
: code(code), repr(repr) { } : code(code), repr(repr) { }
virtual ~Operator() {}
virtual const QString makeExpr(const QStringList &exprs) const=0; virtual const QString makeExpr(const QStringList &exprs) const=0;
virtual OpType type() const=0; virtual OpType type() const=0;
@@ -165,7 +166,7 @@ private:
QuestionMarkOperator() : Operator("qu", "") { } QuestionMarkOperator() : Operator("qu", "") { }
virtual const QString makeExpr(const QStringList &exprs) const virtual const QString makeExpr(const QStringList &exprs) const
{ {
Q_ASSERT(exprs.size() == 2); Q_ASSERT(exprs.size() == 3);
return exprs.first() + " ? " + exprs.at(1) + " : " + exprs.at(2); return exprs.first() + " ? " + exprs.at(1) + " : " + exprs.at(2);
} }
OpType type() const { return TernaryOp; } OpType type() const { return TernaryOp; }