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

    <tr>
        <th>Summary</th>
        <td>
            base class of multiple-inherited template class is mistakenly considered as template base class
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Considering a template class inherits from multiple classes. The base class should NOT be template-class. This issue is exposed when object tries to access ancestor class member functions. The correct base class should be no template and this is correctly recognized in both [GCC](https://www.godbolt.org/z/MhWevrY89) and [MSVC](https://www.godbolt.org/z/5d8611Pnv).

However, for [clang](https://www.godbolt.org/z/8safdcdoK), there is no error message given indicating both template and non-template base class is considered as ancestor.



Considering a template class inherits from multiple classes. 
`template<typename T, typename ...Ts>`
`class Virus : public T, public Ts... {`
`public:`
    `Virus(const T& t, const Ts&... ts): T(t), Ts(ts)... {;}`
`};`


The base class should NOT be template-class. This issue is exposed when object tries to access ancestor class member functions. 
`Virus<string, vector<int>, map<int, string>> s("1234 is a string", {3,4,5}, {{4, string{"four"}}});`

`cout << s.Virus<vector<int>>::size() << endl;`

The correct base class should be no template and this is correctly recognized in both [GCC](https://www.godbolt.org/z/MhWevrY89) and [MSVC](https://www.godbolt.org/z/5d8611Pnv).
`cout << s.vector<int>::size() << endl;`
However, for [clang](https://www.godbolt.org/z/8safdcdoK), there is no error message given, indicating both template and non-template base class is considered as ancestor.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVV1v6zYM_TXMC1HDlvz54IfEaTZguNuAFXfYo2wztnZtKZDkZO2vH-TYbdrs4Q7DNuAChlqJ5OHhocQIa2WniEpIdpDsN2JyvTalks2XfhKqK4pNrdvnstLKypaMVB0KdDSeBuEIm0FYi1L1ZKSzeDR6xHEanDwNi5FsgE89YS3s6m57PQ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