Object.hpp:
class Object { public: virtual ~Object(); };
Object.cpp:
#include "Object.hpp" Object::~Object() { }
Compile it:
>clang++ -v clang version 3.9.0 (branches/release_39) Target: x86_64-pc-windows-msvc Thread model: posix >clang++ -Weverything -c Object.cpp In file included from Object.cpp:1: ./Object.hpp:1:7: warning: 'Object' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] class Object ^ 1 warning generated.
But the object has a virtual method out of turn, so why does Klang generate this warning?
source share