When overriding operator `=` with default fails to compile.
Is this a bug or am I missing something?
Error Message
icpc -std=c++17 sample.cpp ld: /tmp/icpczIU0ix.o:(.rodata._ZTV6Entity[_ZTV6Entity]+0x10): undefined reference to `Entity::operator=(Entity const&)'
Source code
#include <iostream> class Entity { public: Entity() = default; virtual Entity & operator = ( Entity const & )=default; public: int index; }; Entity e1 = Entity(); int main() { std::cout << e1.index; return(0); }
Intel c++ compiler version
icpc (ICC) 19.0.5.281 20190815
TCE Open Date:
Sunday, November 17, 2019 - 20:30