Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.old-deja / g++.brendan / misc9.C
blob0ec12cb30b2730fb794b9c44a5382326467a2ecd
1 // { 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
8 class X {
9 public:
10    X& operator=(const X&) { return *this; }
13 struct S {
14    char c[10];
15    X x;
18 class Y {
19    S s;
20 public:
21    const S& f() const { return s; }
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    }