Open
Description
$ cat test.cpp
class c {
protected:
virtual ~c();
virtual int *d() const;
};
template <typename> class e : c {
int *d() const override;
};
int t = sizeof(e<int>);
$ clang++ -c -std=gnu++2b -Wundefined-func-template test.cpp
test.cpp:7:27: warning: instantiation of function 'e::d' required here, but no definition is available [-Wundefined-func-template]
7 | template class e : c {
I don’t think instantiation of e::d is needed to compute the size of the class.