New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion `T->isRecordType() && "Base class that isn't a record?"' failed #89374
Comments
@llvm/issue-subscribers-clang-frontend Author: Vlad Serebrennikov (Endilll)
While reducing #14534, I stumbled upon the following crash in 3.1, which reproduces in 18 and trunk (https://godbolt.org/z/fh87z5ner):
```cpp
template <typename Derived>
struct MatrixBase {
template <typename OtherDerived>
Derived &operator=(const MatrixBase<OtherDerived> &);
};
template <typename> template <typename Rhs> void ApproximateChebyshev() {
<source>:11:8: error: partial specialization of 'solve_retval' does not use any of its template parameters clang++: /root/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:1325: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
|
@llvm/issue-subscribers-c-1 Author: Vlad Serebrennikov (Endilll)
While reducing #14534, I stumbled upon the following crash in 3.1, which reproduces in 18 and trunk (https://godbolt.org/z/fh87z5ner):
```cpp
template <typename Derived>
struct MatrixBase {
template <typename OtherDerived>
Derived &operator=(const MatrixBase<OtherDerived> &);
};
template <typename> template <typename Rhs> void ApproximateChebyshev() {
<source>:11:8: error: partial specialization of 'solve_retval' does not use any of its template parameters clang++: /root/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:1325: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
|
The diagnostic we emit for this ill-formed program is coming from here: llvm-project/clang/lib/Sema/SemaTemplate.cpp Lines 9454 to 9461 in cee7d99
or here: llvm-project/clang/lib/Sema/SemaTemplate.cpp Lines 5154 to 5162 in cee7d99
and they have a nice // FIXME: Move these checks to CheckTemplatePartialSpecializationArgs so we
// also do them during instantiation. worded slightly differently in the locations. I wonder if moving the checks will fix this? |
Unfortunately, |
Fixes llvm#89374 Solution suggested by @cor3ntin
While reducing #14534, I stumbled upon the following crash in 3.1, which reproduces in 18 and trunk (https://godbolt.org/z/fh87z5ner):
The text was updated successfully, but these errors were encountered: