<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/92486>92486</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang incorrectly emits `-Wundefined-func-template` warning
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            clang:diagnostics
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ahatanak
      </td>
    </tr>
</table>

<pre>
    $ 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<int>::d' required here, but no definition is available [-Wundefined-func-template]
    7 | template <typename> class e : c {

I don’t think instantiation of e<int>::d is needed to compute the size of the class.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8GOozwMfhpzsVpBUgocONB2Kv1P8J9DYiA7NGET09XsYZ99Be3MVDM7K62EjLFj-_s-BxWj7R1RDfkB8lOiZh58qNWgWDn1nLTevNQgdqgVI1PkrZ4mSE-QNrBP78_6qUcVI2qE4nALTMEzaSYDsrlFEK828KxG_KVBlCAqkIePKesYQTTmdgC1d5HfjkFxevdXy3SZRsWEII_8MpFTFwL5hDc4S7h5BIV_7I_-SiFYQ38ZtNQxgjxhtD_JdyBKAnm0jkE-PVL5oMvdLhKOyvUgDiAOuNG4iWxAnno332Kixc3_szPUWUdm081Ob97YfZD-Tv0ek00BshGLwR8qOOv6xbUusnJsFVvv0He4tFx9EMUDdtmAXPQoMND32QYyOFAgEEdsZ0bnccVk11IbUV2VHVU7EkJ--BIy5KdXyRELhOKI_7irm_0PjXfwJKBMoaoYebDu-TO3T3wWpI7IkEH2qP1lmhcdB1r3t5Qs_jp6m5hamkpWKqE6K7K8yrKikMlQ606IXaZIFarLSlMWRrZqn5kiLSkn2ie2FqnYpXlWpCKtpNyW0lCm86zVSgrdlbBL6aLsuB3H62XrQ5_YGGeqK7Er98moWhrj-vMJcbsfsumCd0zOgBAgjg8JY1XvfGSr45LLT0mol7abdu4j7NLRRo7vg9jySPVajNZpHwJpHl-QLpYjwj79enf79PUiJXMY64F5iouu4gzi3Fse5nar_QXEeZl2f22m4L-RZhDnlWMEcV5p_g4AAP__g21Wjw">