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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [misc9.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed miscellaneous
3
//The program listed below produces the following error during compilation:
4
//   % g++ bug17.cc
5
//   bug17.cc: In method `class Y& Y::operator = (const class Y&)':
6
//   bug17.cc:18: invalid use of non-lvalue array
7
 
8
class X {
9
public:
10
   X& operator=(const X&) { return *this; }
11
};
12
 
13
struct S {
14
   char c[10];
15
   X x;
16
};
17
 
18
class Y {
19
   S s;
20
public:
21
   const S& f() const { return s; }
22
 
23
   Y& operator=(const Y& _Y) {
24
      s = _Y.s;    // this line compiles
25
      s = _Y.f();  // this line does not compile
26
      return *this;
27
   }
28
};

powered by: WebSVN 2.1.0

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