OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [ctors19.C] - Diff between revs 154 and 816

Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
// { dg-do assemble  }
// { dg-do assemble  }
// GROUPS passed constructors
// GROUPS passed constructors
// ctor file
// ctor file
// From: mkohtala@vinkku.hut.fi
// From: mkohtala@vinkku.hut.fi
// Date: Tue, 5 Oct 1993 19:31:16 +0200
// Date: Tue, 5 Oct 1993 19:31:16 +0200
// Message-Id: <199310051731.AA12260@lk-hp-11.hut.fi>
// Message-Id: <199310051731.AA12260@lk-hp-11.hut.fi>
// Subject: Nested class constructor calling bug
// Subject: Nested class constructor calling bug
class X
class X
{
{
  public:
  public:
    class Y
    class Y
    {
    {
      public:
      public:
        Y(int i) : a(i) {}
        Y(int i) : a(i) {}
        int a;
        int a;
    };
    };
    static void f(Y y);
    static void f(Y y);
};
};
void X::f(X::Y y)
void X::f(X::Y y)
{
{
}
}
int
int
main()
main()
{
{
    X::Y y = X::Y(1);   // Tries to call ctor Y instead of X::Y
    X::Y y = X::Y(1);   // Tries to call ctor Y instead of X::Y
    X::f(X::Y(2));      // Tries to call Y instead of X::Y
    X::f(X::Y(2));      // Tries to call Y instead of X::Y
    return 0;
    return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.