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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [ctors5.C] - Rev 779

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do assemble  }
// { dg-options "-fshow-column" }
// GROUPS passed constructors
// ctors file
// Subject: bug in handling static const object of the enclosing class
// Date: Tue, 1 Sep 92 10:38:44 EDT

class X
{ // { dg-message "1:X::X\\(const X&\\)" } implicit constructor
  private:
    int x;
  public:
    static const X x0;
    X( int );
};

class Y // { dg-error "1:new types may not be defined in a return type" "err" }
        // { dg-message "1:\\(perhaps a semicolon is missing after the definition of 'Y'\\)" "note" { target *-*-* } 17 }
{
  private:
    X xx;
  public:
    Y();
}
X::X( int xi ) // { dg-error "14:return type specification for constructor invalid" "err" }
// { dg-message "1:candidates are: X::X\\(int\\)" "note" { target *-*-* } 25 }
{
    x = xi;
}

const X X::x0( 0 );

Y::Y() // { dg-error "6:no matching function for call to 'X::X\\(\\)'" }
{
    xx = X::x0;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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