Description of problem: If i overload the operator for a class like the assignment operator. and use it on the same line as declaration of an instance it calls the default operator and not the overloaded one. using the overloaded operator on a different line works. ie: class foo { public: foo& operator=(const foo&) { do some stuff} }; //// //in main method// foo bar = baz; //default called bar = baz; // overloaded called. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
And why do you think this is a bug? foo bar = baz; invokes foo (const foo &) constructor rather than assignment operator, please just read the C++ standard.