This snippet works with gcc 3.3 and 3.4, but fails on 3.5. g++ (GCC) 3.5.0 20040715 (experimental) class Foo {}; class Bar : public Foo { public: struct Item { Item & operator=(Item const &); }; }; g++ -c test.C -o test.o test.C:3: error: declaration of `Bar& Bar::operator=(const Bar&)' test.C:1: error: conflicts with previous declaration `Foo& Foo::operator=(const Foo&)' Please tell if you need the preprocessed sources.
Confirmed. Note that the compiler error refers to the operator= in class Bar, not Bar::Item. If one removes the declaration in Bar::Item, then the error message goes away. It looks as if someone was looking up a name in the wrong scope. Mark, could this be related to your push_/pop_* work? W.
Guess what I saw something like this when compiling QT also.
I failed to check in the name-lookup.c changes that I posted here: http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01493.html Those changes fix this problem. I've now applied that patch.