<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89013>89013</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion !isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
crash
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rupprecht
</td>
</tr>
</table>
<pre>
Live repro: https://godbolt.org/z/xdoYaYTTW
Clang at trunk crashes with this: `clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:15828: bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::ConstantExprKind) const: Assertion !isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.`
Possible dupe of #49570. This seems to be recently worse, as LLVM 18.1 does not crash -- it does, however, reject as invalid. I'm not sure if it would still crash if it were made valid.
```c++
#include <concepts>
// CRTP
template <typename T, typename ConcreteClass>
class Base {
protected:
Base() = default;
~Base() = default;
};
template <typename T>
class Derived final : public Base<T, Derived<T>> {};
template <typename T, typename D>
requires std::derived_from<D, Base<T, D>>
class Foo {
public:
explicit Foo(D* d) {}
};
// CTAD
template <typename T, typename D>
Foo(Base<T, D>*) -> Foo<T, D>;
template <typename T>
using SpecialFoo = Foo<T, Derived<T>>;
SpecialFoo<int> Doit() { return SpecialFoo(new Derived<int>); }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU1v4zYQ_TXjyyCGRNqWdNBBkSKg6BZYbIwt9lRQ4thmS5MqSTlJD_3tBSUntrPdfl0KCIZIv_dm3nCoEd6rvSEqYX0P62YhxnCwrnTjMDjqD2HRWflSflAnQkeDs8ArPIQweOAVsBZYu7eyszosrdsDa38D1j5L-0V82W5_hKSBpJp_ay3MHkXA4EbzC_ZO-AN5fFLhgOGgoh7CJukjDNh9fOIOa521AVir9el4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