Don't crash on interface loop with forwarding types.

From-SVN: r170198
This commit is contained in:
Ian Lance Taylor 2011-02-15 19:53:36 +00:00
parent 4e380b8e00
commit 158559dec9
1 changed files with 3 additions and 2 deletions

View File

@ -5659,7 +5659,7 @@ Interface_type::finalize_methods()
{
if (q->name().empty())
{
if (q->type() == p->type())
if (q->type()->forwarded() == p->type()->forwarded())
error_at(p->location(), "interface inheritance loop");
else
{
@ -5667,7 +5667,8 @@ Interface_type::finalize_methods()
for (i = from + 1; i < this->methods_->size(); ++i)
{
const Typed_identifier* r = &this->methods_->at(i);
if (r->name().empty() && r->type() == q->type())
if (r->name().empty()
&& r->type()->forwarded() == q->type()->forwarded())
{
error_at(p->location(),
"inherited interface listed twice");