do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
bool
do_numeric_constant_value(Numeric_constant* nc) const
{
do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
Type*
do_type();
do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
bool
do_numeric_constant_value(Numeric_constant* nc) const;
do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
bool
do_numeric_constant_value(Numeric_constant* nc) const
{
do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
bool
do_numeric_constant_value(Numeric_constant* nc) const
{
do_is_constant() const
{ return true; }
+ bool
+ do_is_immutable() const
+ { return true; }
+
bool
do_numeric_constant_value(Numeric_constant* nc) const;
bool
do_is_constant() const;
+ bool
+ do_is_immutable() const;
+
bool
do_numeric_constant_value(Numeric_constant*) const;
return true;
}
+// Return whether a type conversion is immutable.
+
+bool
+Type_conversion_expression::do_is_immutable() const
+{
+ Type* type = this->type_;
+ Type* expr_type = this->expr_->type();
+
+ if (type->interface_type() != NULL
+ || expr_type->interface_type() != NULL)
+ return false;
+
+ if (!this->expr_->is_immutable())
+ return false;
+
+ if (Type::are_identical(type, expr_type, false, NULL))
+ return true;
+
+ return type->is_basic_type() && expr_type->is_basic_type();
+}
+
// Return the constant numeric value if there is one.
bool
bool
do_is_immutable() const
- { return this->expr_->is_immutable(); }
+ { return this->expr_->is_immutable()
+ || (this->op_ == OPERATOR_AND && this->expr_->is_variable()); }
bool
do_numeric_constant_value(Numeric_constant*) const;
{ }
protected:
+ bool
+ do_is_immutable() const
+ { return true; }
+
Type*
do_type();