Closed
Description
Live repro: https://godbolt.org/z/xdoYaYTTW
Clang at trunk crashes with this assertion:
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.
#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>); }
Activity
llvmbot commentedon Apr 17, 2024
@llvm/issue-subscribers-clang-frontend
Author: Jordan Rupprecht (rupprecht)
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.
llvmbot commentedon Apr 17, 2024
@llvm/issue-subscribers-c-20
Author: Jordan Rupprecht (rupprecht)
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.
zyn0217 commentedon Apr 17, 2024
cc @hokein
shafik commentedon Apr 17, 2024
Backtrace:
shafik commentedon Apr 18, 2024
Reduced a bit: https://godbolt.org/z/c75YnMfde
4 remaining items