-
Notifications
You must be signed in to change notification settings - Fork 2
Description
When I'm executing the make command,I have meet the problem that has been pointed out, but I don't know how to use the given method to solve this problem. I'm not very good at C ++, can you give me detailed help?
The error:
error: ‘bool IR::Vector::operator==(const IR::Vector&) const [with T = IR::Function]’ marked ‘override’, but does not override
bool operator==(const Vector &a) const override { return vec == a.vec; }
The solve has be given (but I can't understand) :
bool operator==(const Node &a) const override { return a == this; }
bool operator==(const Vector &a) const override { return vec == a.vec; }
/ DANGER -- if you get an error on the above line
* operator== ... marked ‘override’, but does not override
* that mean you're trying to create an instantiation of IR::Vector that
* does not appear anywhere in any .def file, which won't work.
* To make double-dispatch comparisons work, the IR generator must know
* about ALL instantiations of IR class templates, which it does by scanning
* all the .def files for instantiations. This could in theory be fixed by
* having the IR generator scan all C++ header and source files for
* instantiations, but that is currently not done.
*
* To avoid this problem, you need to have your code ONLY use instantiations
* of IR::Vector that appear somewhere in a .def file -- you can usually make
* it work by using an instantiation with an (abstract) base class rather
* than a concrete class, as most of those appear in .def files. */