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++.brendan/] [misc9.C] - Rev 779

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

// { dg-do assemble  }
// GROUPS passed miscellaneous
//The program listed below produces the following error during compilation:
//   % g++ bug17.cc
//   bug17.cc: In method `class Y& Y::operator = (const class Y&)':
//   bug17.cc:18: invalid use of non-lvalue array

class X {
public:
   X& operator=(const X&) { return *this; }
};

struct S {
   char c[10];
   X x;
};

class Y {
   S s;
public:
   const S& f() const { return s; }

   Y& operator=(const Y& _Y) {
      s = _Y.s;    // this line compiles
      s = _Y.f();  // this line does not compile
      return *this;
   }
};

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.