Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / warn / effc2.C
blobfb765f0d81a1517f0d3667d18c60bd64335c54c3
1 // { dg-do compile }
2 // { dg-options "-Weffc++" }
3 // Contributed by Benjamin Kosnik <bkoz at redhat dot com>
4 // PR c++/16169 : Improve -Weffc++ rule 15
6 struct A {
7  const A& foo();
8  const A& operator=(int)
9  { return foo(); }
12 struct B {
13   B& foo();
14   B& operator=(int)
15   { return foo(); }
18 struct C {
19   C& operator=(int)
20   { return *this; }
23 struct D {
24   D operator=(int)
25   { return *this; }      // { dg-warning "should return a reference" }
28 struct E {
29   E& foo();
30   E operator=(int)
31   { return foo(); }      // { dg-warning "should return a reference" }
34 struct F
36   operator float();
37   float operator=(int)
38   { return *this; }      // { dg-warning "should return a reference" }