37 lines · c
1#include "base.h"2 3class Foo : public FooBase {4public:5 Foo();6 7 // Deliberately defined by hand.8 Foo &operator=(const Foo &rhs) {9 x = rhs.x; // break110 a = rhs.a;11 return *this;12 }13 int a;14};15 16namespace ns {17class Foo2 : public Foo2Base {18public:19 Foo2();20 21 // Deliberately defined by hand.22 Foo2 &operator=(const Foo2 &rhs) {23 x = rhs.x; // break224 a = rhs.a;25 return *this;26 }27 28 int a;29};30} // namespace ns31 32extern Foo foo1;33extern Foo foo2;34 35extern ns::Foo2 foo2_1;36extern ns::Foo2 foo2_2;37