if (this->type_ != NULL)
return this->type_;
- if (this->seen_)
+ Named_constant* nc = this->constant_->const_value();
+
+ if (this->seen_ || nc->lowering())
{
this->report_error(_("constant refers to itself"));
this->type_ = Type::make_error_type();
this->seen_ = true;
- Named_constant* nc = this->constant_->const_value();
Type* ret = nc->type();
if (ret != NULL)
{
Named_constant* nc = no->const_value();
- // We can recursively a constant if the initializer expression
- // manages to refer to itself.
+ // Don't get into trouble if the constant's initializer expression
+ // refers to the constant itself.
if (nc->lowering())
return TRAVERSE_CONTINUE;
nc->set_lowering();